python+selenium 火狐浏览器运行不行?
Traceback (most recent call last):
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 64, in start
stdout=self.log_file, stderr=self.log_file)
File "D:\Program Files\Python35\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "D:\Program Files\Python35\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\workspace\Test\selenium_study\worm_1_1.py", line 7, in
browser = webdriver.Firefox()
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__
self.service.start()
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
Exception ignored in:
Traceback (most recent call last):
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__
self.stop()
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'?
现在版本的firefox浏览器,需要下载一个geckodriver驱动放到你的python文件夹里面.
python的配置参数是不是正确
seleninm在新版火狐下可能会有些问题,建议退回至49及以下版本安装使用。