Google chrome closes immediately after being launched with selenium

后端 未结 8 984
说谎
说谎 2021-01-19 09:37

I am on Mac OS X using selenium with python 3.6.3.

This code runs fine, opens google chrome and chrome stays open.:

chrome_options = Options()
chrome         


        
8条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-19 09:56

    def createSession():
        **global driver**
        driver = webdriver.Chrome(chrome_driver_path)
        driver.maximize_window()
        driver.get("https://google.com")
        return driver
    

提交回复
热议问题