Reputation: 51
Tear out codes to bare minimum to troubleshoot
from selenium import webdriver
web = webdriver.Chrome()
web.get('https://www.google.com/')
Browser crashes i.e. opened and closed by itself
Google chrome is: Version 94.0.4606.61 (Official Build) (64-bit)
Tried with different version of chromedriver. There are 3 versions now: https://chromedriver.chromium.org/
https://chromedriver.storage.googleapis.com/index.html?path=95.0.4638.10/ ver95: (got error message which confirms browser version)
Current browser version is 94.0.4606.54 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Ver 93 and 94: (browser crashes for both versions)
https://chromedriver.storage.googleapis.com/index.html?path=94.0.4606.41/ https://chromedriver.storage.googleapis.com/index.html?path=93.0.4577.63/
There is terminal message: DevTools listening on ws://127.0.0.1:51253/devtools/browser/832a4d53-90ec-4f5f-b106-5cc950719cb1 (Tried some suggestions but couldn’t resolve this too.)
Anyone has this problem recently and solved ?
Upvotes: 2
Views: 619
Reputation: 29372
Browser crashes i.e. opened and closed by itself
Your this statement seems okay to me. Since you do not have any code written after
web.get('https://www.google.com/')
line, it is supposed to close the browser.
you can put some time.sleep(5) after the .get()
call, and it would stand still.
Upvotes: 1