How do I put the chrome executable in PATH? Python

1

I'm still trying to open a browser from python, using selenium. This is the code:

from selenium import webdriver
browser=webdriver.Chrome()
browser.get("https://facebook.com")

This error appears:

WebDriverException: 'chromedriver' executable needs to be in PATH. Please see 
https://sites.google.com/a/chromium.org/chromedriver/home

I already downloaded the chromedriver executable but I do not know what is meant by "PATH" I guess it's a file but I do not know what it is.

    
asked by Sebastian Mora 07.12.2018 в 00:43
source

1 answer

2

The path is the search path, and is usually a comma-separated list of folders where the executable will be searched. This path is stored in the environment variable PATH .

You can see its contents by going to the command line and typing

> path

This will print the current value of the variable.

To test if the chromedriver is really in the PATH, go to the command line and type chromedriver (assuming the executable still has that name) and press Enter . If something like Starting ChromeDriver 2.15.322448 appears, the PATH is configured appropriately.

Another alternative is not to take advantage of the surroundings and indicate a complete route:

  driver = webdriver.Chrome ('/ruta/a/chromedriver')

For example:

  driver = webdriver.Chrome ("C:/Users/juan/Downloads/chromedriver_win32/chromedriver.exe")
    
answered by 07.12.2018 в 01:31