Can't use chrome driver for Selenium

后端 未结 12 1175
鱼传尺愫
鱼传尺愫 2020-12-01 03:57

I\'m having trouble using the Chrome driver for Selenium. I have the chromedriver downloaded and saved to C:\\Chrome:

driver = webdriver.Chrome(executable_pa         


        
12条回答
  •  再見小時候
    2020-12-01 04:00

    When you call selenium or any testing automation library, you would need to add this the code here is in Python but this can be done in Java and Ruby as well.

    options = webdriver.ChromeOptions()
    options.binary_location = '/usr/bin/chromium-browser'
    #All the arguments added for chromium to work on selenium
    options.add_argument("--no-sandbox") #This make Chromium reachable
    options.add_argument("--no-default-browser-check") #Overrides default choices
    options.add_argument("--no-first-run")
    options.add_argument("--disable-default-apps") 
    driver = webdriver.Chrome('/home/travis/virtualenv/python2.7.9/chromedriver',chrome_options=options)
    

提交回复
热议问题