Home > other >  Google chrome site closes immediately after being launched with selenium
Google chrome site closes immediately after being launched with selenium

Time:07-12

I tried to a lot of fixes but none worked. Anyone has any idea.I think this is the part where the problem is

    # Creates new Instance of Chrome
    driver = webdriver.Chrome(executable_path=driver_path, options=option)
    driver.set_window_size(1920, 1080)
    driver.maximize_window()
    driver.get('https://snaptik.app/en-us')

    time.sleep(1.5)
    driver.switch_to.window(driver.window_handles[0])

CodePudding user response:

Is your code getting an error message?

You could have different versions of the browser to selenium driver. Maybe reinstall the driver for the version of the browser you have.

Have you tried running any other code using selenium and if so does it run?

CodePudding user response:

When you execute your python in the console inspect the error message. I tested many options using the code above and had the same behavior as you had.

enter image description here

Ensure the Chrome browser and driver enter image description here

  • Related