Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In python, selenium module . how to use firefox driver

I want to use Selenium's Firefox driver. But I got the error shown below. Is it possible that Firefox didn't install properly?

------ my source ------

from selenium import webdriver

driver = webdriver.Firefox()

------ my source End------

Here is the error that was returned:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    browser = webdriver.Firefox()
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 51, in __init__
    self.binary, timeout),
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 43, in launch_browser
    self._start_from_profile_path(self.profile.path)
  File "/usr/local/lib/python2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 65, in _start_from_profile_path
    env=self._firefox_env).communicate()
  File "/usr/local/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/local/lib/python2.7/subprocess.py", line 1228, in _execute_child
    raise child_exception
AttributeError: 'NoneType' object has no attribute 'rfind'
like image 899
user1371662 Avatar asked Oct 07 '22 13:10

user1371662


1 Answers

I faced the same error but got fixed when I installed firefox. Didn't realise that firefox was not installed. Check it out.

like image 105
raju Avatar answered Oct 10 '22 03:10

raju