python selenium webderiver 遇到的问题
2017-01-12 22:08
155 查看
from selenium import webdriver
driver = webdriver.Firefox(executable_path = "C:/Insert/Firefox/geckodriver.exe")
driver.get("http://www.baidu.com")
driver.maximize_window()
driver.find_element_by_id("kw").send_keys("selenium")
driver.find_element_by_id("su").click()
# driver.quit()
1.通过pip 下载的selenium,经查证,版本是3.0.2
2.python版本3.5
3.Firefox 50.0.1
环境描述完毕,作为第一次使用selenium模块的小白,不满足于无头浏览器PhantomJs
使用Firefox+selenium+python
总是无法打开浏览器执行动作,
排除的问题如下:
1.查找不同版本webdriver
2.下载不同版本浏览器 http://blog.csdn.net/huilan_same/article/details/52615123
3.最后在网上看到如下一段话 https://www.zhihu.com/question/49568096
1. selenium 3.x开始,webdriver/firefox/webdriver.py的__init__中,executable_path="geckodriver";而2.x是executable_path="wires"
2. firefox 47以上版本,需要下载第三方driver,即geckodriver;在http://docs.seleniumhq.org/download/的Third Party Drivers, Bindings, and Plugins下面找到Mozilla GeckoDriver,下载到任意电脑任意目录,解压后将该路径加入到PC的path(针对windows)即可。
driver = webdriver.Firefox(executable_path = "C:/Insert/Firefox/geckodriver.exe")
driver.get("http://www.baidu.com")
driver.maximize_window()
driver.find_element_by_id("kw").send_keys("selenium")
driver.find_element_by_id("su").click()
# driver.quit()
1.通过pip 下载的selenium,经查证,版本是3.0.2
2.python版本3.5
3.Firefox 50.0.1
环境描述完毕,作为第一次使用selenium模块的小白,不满足于无头浏览器PhantomJs
使用Firefox+selenium+python
总是无法打开浏览器执行动作,
排除的问题如下:
1.查找不同版本webdriver
2.下载不同版本浏览器 http://blog.csdn.net/huilan_same/article/details/52615123
3.最后在网上看到如下一段话 https://www.zhihu.com/question/49568096
1. selenium 3.x开始,webdriver/firefox/webdriver.py的__init__中,executable_path="geckodriver";而2.x是executable_path="wires"
2. firefox 47以上版本,需要下载第三方driver,即geckodriver;在http://docs.seleniumhq.org/download/的Third Party Drivers, Bindings, and Plugins下面找到Mozilla GeckoDriver,下载到任意电脑任意目录,解压后将该路径加入到PC的path(针对windows)即可。
相关文章推荐
- selenium-webdriver(python)定位问题
- 关于在WindowsXp 环境下Python2.6 + web.py 构建WEB开发环境遇到的问题
- Fixing “selenium.common.exceptions.WebDriverException: Message: ‘Can\’t load the profile.” 分类: 问题总结 python下载 ubuntu python基础学习 2014-01-20 15:28
- 使用selenium的webdriver动态爬取网页时遇到的问题
- 菜鸟学习Python+Selenium遇到的第一个要崩溃的问题
- selenium python 遇到的问题
- selenium python遇到的问题总结
- Python+Selenium遇到的问题
- mac配置python+selenium时遇到的相关问题
- Selenium遇到的问题8 python利用xlwt模块操作xls数据显示IO错误(Python中正反斜杠的用法)
- Selenium WebDriver(1)——入门篇 ---遇到的一些问题
- selenium webDriver 启动Google浏览器遇到的问题
- Python+Selenium框架设计篇之7-进一步实现POM和可能遇到问题解决办法
- python + selenium webdriver 通过python来模拟鼠标、键盘操作,来解决SWFFileUpload调用系统底层弹出框无法定位问题
- Python+Selenium学习遇到的问题总结(一)
- 用python做自动化测试--web 自动化测试(1)-Selenium 3.x使用系列问题集
- selenium_webdriver(python)多层框架/窗口中元素定位问题
- python初学selenium+phantomjs遇到的问题
- Python-Web运行环境搭建中遇到的问题-(ImportError: No module named setuptools)
- 学习selenium + Python 遇到的问题