TransWikia.com

Can not connect to the Service /usr/local/bin/geckodriver in python3

Stack Overflow Asked by Proxyfiber on January 18, 2021

My code:

#!/usr/bin/python3

from selenium import webdriver

driver=webdriver.Firefox(executable_path=r'/usr/local/bin/geckodriver')
driver.get('http://www.python.org')

produces the following error:

ERROR : Message: Can not connect to the Service /usr/local/bin/geckodriver

My settings:

  • Mozilla Firefox 81.0
  • OS => Parrot sec(linux)
  • Python 3.8.6
  • geckodriver 0.27.0

How can I fix this?

One Answer

Move geckodriver file to /usr/bin and than change code as follow.

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

options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)

Hope it helpful. It works in my side.

Answered by Xueming Zheng on January 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP