2

A few weeks ago, I installed Selenium on a Linux Mint (an Ubuntu derivative) machine and developped a few Puthon scrapping scripts with it. Everyhting worked fine.

Now, I am trying to replicate the installation on another machine, also under Linux Mint, and I am stuck. This is what I get:

Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from selenium import webdriver
>>> l_driver = webdriver.Firefox()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/webdriver.py", line 62, in __init__
    firefox_options.binary_location = self.binary if isinstance(self.binary, basestring) else self.binary._get_firefox_start_cmd()
NameError: name 'basestring' is not defined

I installed Selenium exactly the same way as before:

sudo pip3 install -U Selenium

The installation seems ok and does not report any error. Previously, I had installed pip3 with the apt command:

sudo apt-get install python3-pip

Also no errors or problems. I installed a couple of other Python modules with pip3 and they all work.

None of my scripts will run. They all fail on the first line where I want to open a Firefox WebDriver. On my earlier machine however, everything still works fine and all my scripts run flawlessly as before.

What the heck is going on ? What am I missing ? Is this a Python 2 vs. 3 issue (the 'basestring' name points that way) ?

fi11222
  • 275
  • 3
  • 11

1 Answers1

4

It's a bug in the latest version of selenium (2.53.0).

Tim Graham
  • 1,495
  • 3
  • 16
  • 17