Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A problem with using selenium
#1
from selenium import webdriver
browser = webdriver.Firefox()
print(type(browser))
browser.get('http://inventwithpython.com')
In IDLE I receive these traceback errors, don't understand a thing.
Error:
Traceback (most recent call last): File "C:\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "C:\Python36\lib\subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "C:\Python36\lib\subprocess.py", line 997, 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 "<pyshell#1>", line 1, in <module> browser = webdriver.Firefox() File "C:\Python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 157, in __init__ self.service.start() File "C:\Python36\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: 'geckodriver' executable needs to be in PATH. >>> print(type(browser)) Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> print(type(browser)) NameError: name 'browser' is not defined >>> browser.get('http://inventwithpython.com') Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> browser.get('http://inventwithpython.com') NameError: name 'browser' is not defined
Reply
#2
You need to download latest geckodriver from here - LINK and then update the Path system variable to add the full directory path to the executable geckodriver.
Reply
#3
Thank you. I downloaded it and unzipped in Python folder. Interestingly, didn't need to updatethe Path system variable.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with Selenium webdriver Fred 1 2,030 Jan-10-2022, 05:45 PM
Last Post: Larz60+
  Selenium Webdriver Memory Problem? satbir129 2 6,857 Mar-01-2019, 04:17 AM
Last Post: satbir129
  Pull Down Menu Problem using Selenium ber 1 2,461 Nov-15-2018, 01:22 AM
Last Post: Larz60+
  Looping problem using Selenium smk90 0 2,256 Sep-19-2018, 08:48 PM
Last Post: smk90
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,619 Nov-03-2017, 08:41 PM
Last Post: metulburr
  Python Selenium WebDriver Problem SlpnGnt 2 7,376 Apr-01-2017, 10:40 PM
Last Post: SlpnGnt
  Running a selenium test using data from spreadsheet (have problem iterating...) danw32 0 3,089 Mar-07-2017, 12:40 PM
Last Post: danw32

Forum Jump:

User Panel Messages

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