Script running independently perfect. So no drive issue at all.
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.
Exception occured!Message: session not created from tab crashed (Session info: headless chrome=89.0.4389.82)
This is my script.
import time
from selenium import webdriver
print(str(sys.argv[1]))
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_options.binary_location = '/usr/bin/google-chrome'
try:
browser = webdriver.Chrome(executable_path="/usr/local/bin/chromedriver",options=chrome_options)
browser.get(sys.argv[1])
time.sleep(5)
browser.quit()
except Exception as error:
print("\nException occured!" + str(error))
This is chromedriver log.
[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 {
"capabilities": {
"alwaysMatch": {
"browserName": "chrome",
"goog:chromeOptions": {
"args": [ "--headless", "--disable-dev-shm-usage", "--no-sandbox", "--enable-logging", "--log-lelvel=1" ],
"binary": "/usr/bin/google-chrome",
"extensions": [ ]
},
"platformName": "any"
},
"firstMatch": [ {
} ]
},
"desiredCapabilities": {
"browserName": "chrome",
"goog:chromeOptions": {
"args": [ "--headless", "--disable-dev-shm-usage", "--no-sandbox", "--enable-logging", "--log-lelvel=1" ],
"binary": "/usr/bin/google-chrome",
"extensions": [ ]
},
"platform": "ANY",
"version": ""
}
}
[1615546808.081][INFO]: Populating Preferences file: {
"alternate_error_pages": {
"enabled": false
},
"autofill": {
"enabled": false
},
"browser": {
"check_default_browser": false
},
"distribution": {
"import_bookmarks": false,
"import_history": false,
"import_search_engine": false,
"make_chrome_default_for_user": false,
"skip_first_run_ui": true
},
"dns_prefetching": {
"enabled": false
},
"profile": {
"content_settings": {
"pattern_pairs": {
"https://*,*": {
"media-stream": {
"audio": "Default",
"video": "Default"
}
}
}
},
"default_content_setting_values": {
"geolocation": 1
},
"default_content_settings": {
"geolocation": 1,
"mouselock": 1,
"notifications": 1,
"popups": 1,
"ppapi-broker": 1
},
"password_manager_enabled": false
},
"safebrowsing": {
"enabled": false
},
"search": {
"suggest_enabled": false
},
"translate": {
"enabled": false
}
}
[1615546808.081][INFO]: Populating Local State file: {
"background_mode": {
"enabled": false
},
"ssl": {
"rev_checking": {
"enabled": 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 ["127.0.0.1"]
[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