title: Selenium python script run independently perfect. But when i embed same code into my webapplication then its giving error
body: <p>Script running independently perfect. So no drive issue at all.</p>
  <p>i have one webapplication in Odoo(its kind of webframework you can say) like Django. And i put button on my screen and add same code like above script. but its gives me error.</p>
  <p>Exception occured!Message: session not created
  from tab crashed
  (Session info: headless chrome=89.0.4389.82)</p>
  <p>This is my script.</p>
  <pre><code>import time
  from selenium import webdriver
  
  print(str(sys.argv[1]))
  
  chrome_options = webdriver.ChromeOptions()
  chrome_options.add_argument(&quot;--headless&quot;)
  chrome_options.add_argument(&quot;--disable-dev-shm-usage&quot;)
  chrome_options.add_argument(&quot;--no-sandbox&quot;)
  chrome_options.binary_location = '/usr/bin/google-chrome'
  try:
      browser = webdriver.Chrome(executable_path=&quot;/usr/local/bin/chromedriver&quot;,options=chrome_options)
      browser.get(sys.argv[1])
      time.sleep(5)
  
      browser.quit()
  except Exception as error:
      print(&quot;\nException occured!&quot; + str(error))
  
  </code></pre>
  <p>This is chromedriver log.</p>
  <pre><code>[1615546807.082][INFO]: Starting ChromeDriver 89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}) on port 40727
  [1615546807.082][INFO]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
  [1615546808.081][INFO]: [efb84f932f5a9088d79b04ddc066fdd2] COMMAND InitSession {
     &quot;capabilities&quot;: {
        &quot;alwaysMatch&quot;: {
           &quot;browserName&quot;: &quot;chrome&quot;,
           &quot;goog:chromeOptions&quot;: {
              &quot;args&quot;: [ &quot;--headless&quot;, &quot;--disable-dev-shm-usage&quot;, &quot;--no-sandbox&quot;, &quot;--enable-logging&quot;, &quot;--log-lelvel=1&quot; ],
              &quot;binary&quot;: &quot;/usr/bin/google-chrome&quot;,
              &quot;extensions&quot;: [  ]
           },
           &quot;platformName&quot;: &quot;any&quot;
        },
        &quot;firstMatch&quot;: [ {
  
        } ]
     },
     &quot;desiredCapabilities&quot;: {
        &quot;browserName&quot;: &quot;chrome&quot;,
        &quot;goog:chromeOptions&quot;: {
           &quot;args&quot;: [ &quot;--headless&quot;, &quot;--disable-dev-shm-usage&quot;, &quot;--no-sandbox&quot;, &quot;--enable-logging&quot;, &quot;--log-lelvel=1&quot; ],
           &quot;binary&quot;: &quot;/usr/bin/google-chrome&quot;,
           &quot;extensions&quot;: [  ]
        },
        &quot;platform&quot;: &quot;ANY&quot;,
        &quot;version&quot;: &quot;&quot;
     }
  }
  [1615546808.081][INFO]: Populating Preferences file: {
     &quot;alternate_error_pages&quot;: {
        &quot;enabled&quot;: false
     },
     &quot;autofill&quot;: {
        &quot;enabled&quot;: false
     },
     &quot;browser&quot;: {
        &quot;check_default_browser&quot;: false
     },
     &quot;distribution&quot;: {
        &quot;import_bookmarks&quot;: false,
        &quot;import_history&quot;: false,
        &quot;import_search_engine&quot;: false,
        &quot;make_chrome_default_for_user&quot;: false,
        &quot;skip_first_run_ui&quot;: true
     },
     &quot;dns_prefetching&quot;: {
        &quot;enabled&quot;: false
     },
     &quot;profile&quot;: {
        &quot;content_settings&quot;: {
           &quot;pattern_pairs&quot;: {
              &quot;https://*,*&quot;: {
                 &quot;media-stream&quot;: {
                    &quot;audio&quot;: &quot;Default&quot;,
                    &quot;video&quot;: &quot;Default&quot;
                 }
              }
           }
        },
        &quot;default_content_setting_values&quot;: {
           &quot;geolocation&quot;: 1
        },
        &quot;default_content_settings&quot;: {
           &quot;geolocation&quot;: 1,
           &quot;mouselock&quot;: 1,
           &quot;notifications&quot;: 1,
           &quot;popups&quot;: 1,
           &quot;ppapi-broker&quot;: 1
        },
        &quot;password_manager_enabled&quot;: false
     },
     &quot;safebrowsing&quot;: {
        &quot;enabled&quot;: false
     },
     &quot;search&quot;: {
        &quot;suggest_enabled&quot;: false
     },
     &quot;translate&quot;: {
        &quot;enabled&quot;: false
     }
  }
  [1615546808.081][INFO]: Populating Local State file: {
     &quot;background_mode&quot;: {
        &quot;enabled&quot;: false
     },
     &quot;ssl&quot;: {
        &quot;rev_checking&quot;: {
           &quot;enabled&quot;: false
        }
     }
  }
  [1615546808.082][INFO]: Launching chrome: /usr/bin/google-chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --headless --log-lelvel=1 --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.Mikx1r data:,
  [1615546808.260][INFO]: resolved localhost to [&quot;127.0.0.1&quot;]
  [1615546808.802][INFO]: [efb84f932f5a9088d79b04ddc066fdd2] RESPONSE InitSession ERROR session not created
  from tab crashed
    (Session info: headless chrome=89.0.4389.82)
  tail: /tmp/chromedriver.log: file truncated
  </code></pre>