selenium+python+chrome
来源:互联网 发布:北京软件招聘 编辑:程序博客网 时间:2024/06/08 03:49
还是chrome浏览器比较强悍
包括上次yslow也是,很多测试工具对于新版本的火狐浏览器不能使用,但是对于chrome来说就没问题,这次也是
使用场景:windows环境下利用python3.6.0+Selenium3.4.0+Firefox53.0进行自动化测试
问题:执行自动化脚本报错:
Traceback (most recent call last):
File "C:\Users\Administrator.USER-20160704ZY\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\Administrator.USER-20160704ZY\AppData\Local\Programs\python\Python35-32\lib\subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "C:\Users\Administrator.USER-20160704ZY\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1220, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/python/代码/baidu.py", line 7, in <module>
driver=webdriver.Firefox()
File "C:\Users\Administrator.USER-20160704ZY\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 142, in __init__
self.service.start()
File "C:\Users\Administrator.USER-20160704ZY\AppData\Local\Programs\Python\Python35-32\lib\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.
所以需要在安装目录C:\Users\Administrator\AppData\Local\Programs\Python\Python36中加入driver,第一次试了火狐的geckodriver,还是不行,觉得是火狐版本的问题
所以找了chrome的Chromedriver,一次成功!棒棒哒!
下面是解决问题的链接,里面的driver链接都不能用,我表示很无语。。。
http://blog.csdn.net/limeilian10221017/article/details/70570056
最后在交流群的文件区找到了driver,哈哈哈~
- selenium+python+chrome
- Selenium+Python+Chrome 浏览器操作
- selenium+python+chrome 骚起来
- python + selenium + chrome环境搭建
- Selenium+Chrome(PhantomJs) Python爬虫
- Python-selenium-Firefox-chrome-IE问题解决方法
- 模拟页面输入:python + selenium + chrome
- Python+Selenium+Chrome抓取京东商品信息
- python selenium环境配置Firefox和Chrome
- Python-selenium-Firefox-chrome-IE问题解决方法
- python+chrome+Selenium模拟手机浏览器
- 记一次python+selenium+chrome爬虫
- python+selenium+firefox/chrome版本兼容问题记录
- Python配置Selenium+Chrome环境和Selenium+PhantomJS环境
- python selenium chrome notepad++ 搭建自动化测试平台
- Python + Selenium 入门之启动IE、Chrome浏览器
- Linux配置Selenium+Chrome+Python实现自动化测试
- selenium web 自动化环境搭建(Windows7 环境, Chrome, Python)
- 直播聊天室消息类型
- 可拖动的滑动面板和Menu的实现(SlidingUpPanelLayout)
- 公开的海量数据集 Public Research-Quality Datasets
- IOS 添加/移除子视图
- 一天装软件有感
- selenium+python+chrome
- android缓存的机制
- 深度学习笔记——深度学习框架TensorFlow之DNN深度神经网络的实现(十四)
- 'E:\Program' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
- Intel HAXM is required to run this AVD VT-x is disabled in BIOS的处理方法
- hibernate 基本配置
- virtualenv 虚拟环境的使用
- Redux, Redux thunk 和 React Redux 源码阅读
- python3 HTMLTestRunner测试报告中文乱码