Set chrome browser binary through chromedriver in Python

前端 未结 4 1793
醉梦人生
醉梦人生 2020-12-01 16:38

I used Selenium with Python Chrome webdriver. In my code I used:

driver = webdriver.Chrome(executable_path = PATH_TO_WEBDRIVER)

to point th

4条回答
  •  醉梦人生
    2020-12-01 17:15

    Thanks a lot I was struggling with this for 2.5 hours as I did not know how to set the Chrome Executable path in Python. Works now

    options = Options()
    options.binary_location = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
    driver = webdriver.Chrome(chrome_options=options, executable_path="C:/Utility/BrowserDrivers/chromedriver.exe", )
    

提交回复
热议问题