环境:Win7
Firefox浏览器版本37.0.1
Python36
Selenium2.53.0
在Pycharm里执行以下3行脚本:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://www.baidu.com")
报错如下:
File "/python36/Lib/site-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
解决方法:将2.53.0版本的selenium卸载掉,安装2.53.1版本的selenium