Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97771

Issues running ChromeDriver and FirefoxDriver with Selenium

$
0
0

Tried adding the drivers to the right path. mentioned the path in the code and yet getting runtime errors with chromedriver. Cannot see what is wrong with the code. whats wrong?

Tried adding the path to the code. imported selenium and webdriver. placed the drivers in the python directory.

from selenium import webdriver

#to open the page in Chrome.firefox

driver = webdriver.Chrome("executable_path=D:\Python\Crawler\chromedriver_win32")
driver.get("http://econpy.pythonanywhere.com/ex/001.html")

given Below are the errors:

D:\Python\Crawler\venv\Scripts\python.exe D:/Python/Crawler/crawler_sel.py
Traceback (most recent call last):
  File "D:\Python\Crawler\venv\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "C:\Users\vidwa\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\vidwa\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/Python/Crawler/crawler_sel.py", line 5, in <module>
    driver = webdriver.Chrome("executable_path=D:\Python\Crawler\chromedriver_win32")
  File "D:\Python\Crawler\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "D:\Python\Crawler\venv\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver_win32' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home


Process finished with exit code 1

Viewing all articles
Browse latest Browse all 97771

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>