Python + selenium 实践问题(一)
来源:互联网 发布:二维数组下标越界 编辑:程序博客网 时间:2024/06/15 14:44
最近遇到重复操作网页的工作,感觉绝大部分内容是重复劳动就想脚本来完成,想到了用Python 网上搜了一下推荐使用Python+selenium 一下是我第一步测试代码:
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
browser = webdriver.Firefox()
browser.get('https://www.baidu.com')
browser.close
遇到的问题:
Traceback (most recent call last):
File "test1.py", line 7, in <module>
browser = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 154, in __init__
keep_alive=True)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 151, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status: 1
问题原因:
我是远程登陆Ubuntu系统的,远程securitCRT无法显示网页
解决办法:
直接在Ubuntu系统的电脑上运行该代码就好了
- Python + selenium 实践问题(一)
- python+selenium+eclipse问题排查(一)
- selenium+Python+firefox动手实践一
- Python+Selenium学习遇到的问题总结(一)
- python selenium学习(一)
- selenium+python 自动化(一)
- python+selenium环境搭建(一)
- (selenium 一)python+webdriver环境搭建
- selenium-webdriver (python)(一)学习笔记
- Page Object Model (Selenium, Python)(一)
- 自动化测试(python+selenium)入门(一)
- Selenium with Python中文翻译(一)
- selenium-Python之unittest(一)
- selenium+python:脚本学习笔记(一)
- selenium-webdriver(python) (一)
- Selenium+Python Test(一)
- mac+selenium+python 一
- Python Selenium 问题记录
- java中的参数传递
- Shiro (二) JDBC Realm
- Mybatis问题:There is no getter for property named 'Id' in 'class java.lang.String'
- 1048. 数字加密(20)
- 11.14学习心得
- Python + selenium 实践问题(一)
- 牛客网初级算法(1)
- SQL Server2008 学习之(五) :规则与约束的用法与联系
- 我的校招总结
- 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:sss
- xshell远程连接工具不能连接本地刚安装的linux系统(网络模式选择“NAT模式”)
- 用户注册数据库登记
- ios面试题详解-二
- 2017深信服校招笔经面经 软件测试工程师