selenium+python+firefox解决不安全连接的方法
2018-01-25 11:07
337 查看
1.firefox创建用户profile
firefox.exe -p创建用户profile
2.在1创建的用户profile中将需要访问的站点设置为信任
3.selenium启动浏览器时设置启动1创建的用户profile
代码如下:
#coding=utf_8 from selenium import webdriver from time import time,sleep #指定配置文件地址 profile_directory = r"C:\Users\zhouj\AppData\Roaming\Mozilla\Firefox\Profiles\oj9vd1gi.zj_selenium_test" #加载配置 profile = webdriver.FirefoxProfile(profile_directory) #启动浏览器配置 br=webdriver.Firefox(profile) br.get("https://192.168.211.218") br.find_element_by_id("username").send_keys("superadmin") br.find_element_by_id("password").send_keys("p@ssw0rd") sleep(2) br.find_element_by_class_name("s-button").click() url=br.current_url print (url)
相关文章推荐
- python爬虫,selenium使用,Firefox-chrome-IE问题解决方法,selenium的基本操作
- python中使用selenium调用Firefox缺少geckodriver解决方法
- Python-selenium-Firefox-chrome-IE问题解决方法
- Python-selenium-Firefox-chrome-IE问题解决方法
- Tomcat启用SSL导致Firefox出现“安全连接失败”错误的解决方法
- Python连接mssql数据库编码问题解决方法
- 终端服务器安全层在协议流中检测到错误,并已取消客户端连接。客户端IP:x.x.x.解决方法
- (selenium 小知识点)解决使用Webdrive打开Firefox不含有插件的问题(python)
- Selenium-解决使用Webdrive打开Firefox不含有插件的问题(python)
- 在Linux环境下mysql的root密码忘记解决方法 1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库。 2.修改MySQL的登录设置: # vi /etc/my.c
- selenium+python解决有关富文本框的方法
- Python Selenium 启动新版本Firefox失败问题解决方案
- windows+python3.5环境下安装selenium后无法导入webdriver的解决方法
- python selenium运行,打包exe常见问题解决方法
- Fiddler下Firefox提示“您的连接并不安全”的解决办法
- 关于firefox安全限制剪贴板操作的解决方法
- python连接sql server乱码的解决方法
- Python使用Selenium测试WebApp在定位元素和使用元素属性报的莫名其妙错误的终极解决方法
- 使用Python2.7操作Selenium2时只打开浏览器不load URL的解决方法
- Python+Selenuim测试网站,只能打开Firefox浏览器却不能打开网页的解决方法