Webdriver does not open browser

1

I've tried everything, but I can not get the code working.

from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://www.google.com")

It stops on the second line, the browser does not open. I already downloaded chromedriver.exe, I put it in the same folder as the project, already tried pointing to the diterório, but it does not work. The code does not point to any error, the code simplicissamente stops in the second line.

    
asked by anonymous 25.12.2018 / 14:00

1 answer

0

Unless the Chromedriver is in the machine path, which by default is not, you need to pass the Chromedriver path as a parameter to get the webdriver, for example:

browser = webdriver.Chrome('C:\path\to\chromedriver.exe')
    
07.01.2019 / 13:12