Set chrome browser binary through chromedriver in Python

前端 未结 4 1795
醉梦人生
醉梦人生 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:16

    First of all if you want to use chrome then you need to download it's binary from below URL :-

    https://sites.google.com/a/chromium.org/chromedriver/
    

    Now you need to pass this driver path to the selenium webdriver.

    If you are using python the code should be like below :-

        driver = webdriver.Chrome('C:\Users\name\Downloads\chromedriver_win32 (3)\chromedriver.exe')
        driver.implicitly_wait(30) # seconds
        driver.get('https://www.google.co.in/')
    

    Hope it will help you :)

提交回复
热议问题