(selenium 小知识点)解决使用Webdrive打开Firefox不含有插件的问题(python)
2016-06-02 09:54
721 查看
转载:http://www.cnblogs.com/roicel/archive/2013/03/27/2984551.html?utm_source=tuicool&utm_medium=referralfrom selenium import webdriver

,点击帮助

并选择
故障排除信息 菜单项以打开故障排除信息标签页。
在 应用程序概要 部分,点击 显示文件夹 按钮,将打开一个窗口显示您的配置文件。
from selenium import webdriver import unittest class Register(unittest.TestCase): def setUp(self): self.profileDir = r"C:\Users\xxxx\AppData\Roaming\Mozilla\Firefox\Profiles\93a9ic09.default" #配置文件,详见要点1 self.profile = webdriver.FirefoxProfile(self.profileDir) self.driver = webdriver.Firefox(self.profile) self.driver.implicitly_wait(30) self.base_url = "http://www.baidu.com/" self.verificationErrors = [] self.accept_next_alert = True #百度搜索用例 def test_baidu_search(self): '''百度搜索''' driver = self.driver driver.get(self.base_url + "/") driver.find_element_by_id("kw").send_keys("selenium webdriver") driver.find_element_by_id("su").click() time.sleep(2) driver.close() if __name__ == "__main__": unittest.main()
怎么找到我的用户配置文件?
https://support.mozilla.org/zh-CN/kb/%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6
点击菜单按钮
,点击帮助

并选择
故障排除信息 菜单项以打开故障排除信息标签页。
在 应用程序概要 部分,点击 显示文件夹 按钮,将打开一个窗口显示您的配置文件。
相关文章推荐
- 转帖文章(感谢作者)-pyenv安 3ff0 装与使用-多版本python共存解决方法
- Python 进阶 —— 重访 tuple
- leetcode 48. Rotate Image-矩阵旋转
- Python复杂对象转JSON
- 17个新手常见Python运行时错误
- python random模块
- 2. python入门杂记
- python类1
- [python]源码:对象
- Python Version 2.7 required which was not found in the registry
- [python]编码处理小结
- 怎么查看python是32位还是64位的
- 解决python连接mysql,UTF-8乱码问题
- 为什么会出现Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 问题?
- 文成小盆友python-num4 装饰器,内置函数
- Python-Matplotlib安装及简单使用
- Python:Django【基础篇】
- 初识python 交叉排序
- 2016年6月2日 几乎是强迫自己在更新 关于python的多线程处理
- [Python爬虫]爬取贴吧图片