L
L
leroy-bit2021-08-03 14:32:47
Python
leroy-bit, 2021-08-03 14:32:47

How to solve selenium error?

Error:
selenium.common.exceptions.WebDriverException: Message: No such file or directory (os error 2) at path

Run on heroku:
Selenium + Firefox

Code start:

from selenium import webdriver
from selenium.webdriver.firefox.options import Options


options = Options()
options.headless = True
options.binary_location = "vendor/firefox/firefox"
driver = webdriver.Firefox(options=options, executable_path="vendor/geckodriver")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
taktik, 2021-08-03
@taktik

Pass an absolute path to the driver, not a relative one.
But it's better to use docker-selenium

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question