博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mac系统上,Firefox和Selenium不兼容的情况
阅读量:4841 次
发布时间:2019-06-11

本文共 1975 字,大约阅读时间需要 6 分钟。

解决办法,检查环境:

Python 2.7.10
Firefox 46版本
Selenium 2.53.6

注意:将Firefox自动更新关闭,否则可能会出现自动升级以后无法执行Selenium用例的情况。

错误如下:

MacBookPro:Github apple$ python3 test.pyTraceback (most recent call last):  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 74, in start    stdout=self.log_file, stderr=self.log_file)  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 859, in __init__    restore_signals, start_new_session)  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 1457, in _execute_child    raise child_exception_type(errno_num, err_msg)FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "test.py", line 4, in 
browser = webdriver.Firefox() File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 140, in __init__ self.service.start() File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 81, 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 "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 173, in __del__ self.stop() File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 145, in stop if self.process is None:AttributeError: 'Service' object has no attribute 'process'

mac系统上firefox和selenium不兼容

这个问题与之前总结的问题是同一类问题:

转载于:https://www.cnblogs.com/bull_think/p/Mac-platform-Firefox-Selenium-problem.html

你可能感兴趣的文章
PAT A1009 Product of Polynomials(25)
查看>>
libFFM 与 python-libffm 安装遇到的一系列问题-解决方案
查看>>
数据摘要pandas
查看>>
浅谈C语言中的位段
查看>>
2019.04.25 第七次训练 【2017-2018 ACM-ICPC Asia East Continent League Final (ECL-Final 2017)】...
查看>>
javascript正则表达式复习
查看>>
【JVM】类加载器及双亲委派机制实例解析
查看>>
python 生成 pyc 文件
查看>>
linux清除git账号密码
查看>>
grep awk 查看nginx日志中所有访问的ip并 去重
查看>>
vue 遇到防盗链 img显示不出来
查看>>
C# GDI graphics.DrawImage 的参数问题
查看>>
【WPF】2、美化控件
查看>>
css 光标
查看>>
深入理解await与async
查看>>
将一个数字扁平化,去重并升序
查看>>
边缘缓存模式(Cache-Aside Pattern)
查看>>
博文汇总
查看>>
在Java大环境下.NET程序员如何夺得一线生机
查看>>
GUID做主键真的合适吗
查看>>