Python GUI自动化实现绕过验证码登录
2020-02-13 10:06
477 查看
这篇文章主要介绍了python GUI自动化实现绕过验证码登录,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
1. 获取cookies
实现代码如下:
import time from selenium import webdriver class cookies_login: wd=webdriver.Chrome() def getCookies(self): wd=self.wd wd.maximize_window() #登录成功跳转后的页面 url = "http://47.108.47.47:81/admin" #登录页面 wd.get("http://47.108.47.47:81/admin/login?company=9") while True: print("please login") time.sleep(3) while wd.current_url == url: cookies=wd.get_cookies() wd.quit() return cookies
2. 绕过验证码登录
实现代码如下:
from selenium import webdriver import time from xctest_selenium.get_cookies import * class NoSignLogin: def get_nosignlogin(self): cookies=cookies_login().getCookies() wd=webdriver.Chrome() wd.maximize_window() wd.implicitly_wait(20) # 登录成功跳转后的页面 wd.get("http://47.108.74.74:81/admin#datacount") for cookie in cookies: wd.add_cookie(cookie) time.sleep(3) wd.refresh()
以上就是本文的全部内容,希望对大家的学习有所帮助
您可能感兴趣的文章:
相关文章推荐
- python接口自动化4-绕过验证码登录(cookie)
- python接口自动化(十三)--cookie绕过验证码登录(详解)
- Python Selenium Cookie 绕过验证码实现登录
- Python Selenium Cookie 绕过验证码实现登录示例代码
- python接口自动化4-绕过验证码登录(cookie)
- Python 实现全自动登录(真正的全自动,自动识别验证码)
- python实现ssh自动化登录遇到的坑
- Python用代码实现验证码登录
- Python爬虫实现验证码登录
- 15.Python实现识别登录验证码(入门)
- Selenium2+python自动化41-绕过验证码(add_cookie)
- Python+selenium+unittest的GUI自动化框架实现
- Python使用selenium实现网页用户名 密码 验证码自动登录功能
- [置顶] python 自动化模块selenium + pyauotogui 模块结合实现有flash显示自动化运维
- 基于Python的Selenium自动化(3)— 实现验证码截取并识别
- Python+selenium的GUI自动化实现
- Appium+Python实现自动化登录
- Python爬虫实现验证码登录代码实例
- Appium+python实现App自动化登录
- selenium+python实现自动化登录的方法