Python Forum
Selenium error with ebdriver (geckodriver)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium error with ebdriver (geckodriver)
#2
Quote:I have changed the permission from the / with rmx to all users, directories and files, in case, "geckodriver". Also, I have inserted "geckodriver" and its PATH on the enviromnent PATH, and, also, to the "Interpreter Paths".
You should not need to do any of that. The only odd thing might be PyCharm specific.

just copy geckodriver to your /usr/local/bin

example:
metulburr@ubuntu:~$ cat test11.py
from selenium import webdriver
nav = webdriver.Firefox()
metulburr@ubuntu:~$ python3 test11.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "/usr/local/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.6/subprocess.py", line 1326, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test11.py", line 2, in <module>
    nav = webdriver.Firefox()
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 144, in __init__
    self.service.start()
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 81, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 
metulburr@ubuntu:~$ mv /home/geckodriver /usr/local/bin
mv: cannot move '/home/geckodriver' to '/usr/local/bin/geckodriver': Permission denied
metulburr@ubuntu:~$ sudo !!
sudo mv /home/geckodriver /usr/local/bin
[sudo] password for metulburr:
metulburr@ubuntu:~$ python3 test11.py
metulburr@ubuntu:~$ 
you could also just set the path directly
driver = webdriver.Firefox(executable_path='your\path\geckodriver')
Recommended Tutorials:
Reply


Messages In This Thread
RE: Selenium error with ebdriver (geckodriver) - by metulburr - Sep-23-2019, 01:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium weird error julio2000 0 1,718 Feb-23-2020, 01:24 PM
Last Post: julio2000
  Selenium webdriver error WiPi 4 12,332 Feb-09-2020, 11:38 AM
Last Post: WiPi
  error when running headless selenium julio2000 2 4,658 Feb-01-2020, 12:41 PM
Last Post: julio2000
  Error clicking button with selenium julio2000 4 5,432 Jan-06-2020, 10:59 AM
Last Post: julio2000
  Python Selenium .click() Loads Error - Works Manually.- Events not Triggered NSearch 24 12,162 Aug-14-2019, 02:23 PM
Last Post: NSearch
  Error when trying to use Selenium ejected 1 5,261 Mar-26-2019, 04:53 AM
Last Post: ejected
  Instagramlogin Error (Selenium) julian_veit 0 2,689 Jan-26-2019, 02:40 PM
Last Post: julian_veit
  selenium error : evilcode1 7 5,287 Nov-12-2018, 01:08 PM
Last Post: snippsat
  Getting error when accessing elements in a modal window of an webpage using selenium sumandas89 3 8,773 Jul-13-2018, 10:44 AM
Last Post: mlieqo
  Python 3/selenium - nontype error water_fox 2 11,997 Jun-28-2018, 08:19 PM
Last Post: Sudhakar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020