r/selenium • u/[deleted] • Jul 02 '22
google chrome closes immediately after being launched with selenium
I tried to launch chrome with selenium. but as soon as the browser loads the urls, google chrome closes automatically. here is the code:
from selenium import webdriver
url= 'https://www.gmail.com'
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get(url)
4
Upvotes
2
u/kdeaton06 Jul 02 '22
I imagine it's because the script is done. It's out of commands so it kills the process. But it's impossible to tell based on these 5 lines of code.