Forums

Message: 'geckodriver' executable needs to be in PATH

I am getting the error "Message: 'geckodriver' executable needs to be in PATH".

I am trying to use selenium, here is my code:

from selenium.webdriver.firefox.options import Options from shutil import which from pyvirtualdisplay import Display

with Display():
    opts = Options()
    opts.binary = which("firefox")
    opts.add_argument("--headless")
    driver = webdriver.Firefox(firefox_options=opts, log_path = "geckodriver.log")

Any ideas? What should I do?

Has switching to Chrome (as discussed in another topic) solved your problems?

i can't solve this to <h1>o</h1>

<h1>njnn</h1>

@nurbolat01batyrbek We need more details to help you