Chrome Driver - Selenium
I'm a new student of programmin and I'm trying to use Chromedriver and Selenium for the first time. I definitely can't access to the downloaded file, don't know why. This is my inp
Solution 1:
I dont know if you already solved this problem, but this also happened to me and I realized that after downloading chromedriver I forgot to put the file inside the very same directory where python.exe is located. Usually, you can find your python.exe file by going to (C:) --> Users --> your User and finally anaconda3 directory (if you installed anaconda package, wich I highly recommend). Put your chromedriver file inside anaconda3 directory, which is the exact same place where you can find python.exe. And thats it! After doing this, I could run my code without a problem. Greetings from Brazil! ;)
Solution 2:
Solution 3:
Without giving executable path:
You can use webdriver_manage
(install it by pip install webdriver_manager
)
from bs4 importBeautifulSoupfrom selenium import webdriver
from selenium.webdriver.chrome.optionsimportOptionsfrom webdriver_manager.chromeimportChromeDriverManager
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=chrome_options)
Post a Comment for "Chrome Driver - Selenium"