当前位置:网站首页>Selenium automatically logs into QQ space (headless and evasive)
Selenium automatically logs into QQ space (headless and evasive)
2022-04-22 00:10:00 【qq_ thirty-six million two hundred and ninety-two thousand five】
Headless parameter setting :
from selenium.webdriver.edge.options import Options
options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
Avoid parameter setting :
options.add_experimental_option('excludeSwitches',['enable-automation'])
Positioning label :
from selenium.webdriver.common.by import By
Full code
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.edge.options import Options
options = Options()
# Headless parameter setting
options.add_argument('--headless')
options.add_argument('--disable-gpu')
# Avoid parameter setting
options.add_experimental_option('excludeSwitches',['enable-automation'])
url = 'https://qzone.qq.com/'
driver = webdriver.Edge(options=options)
driver.get(url)
# Locate the label where the account and password are logged in
driver.switch_to.frame('login_frame')
login_link = driver.find_element(By.ID,value='switcher_plogin')
login_link.click()
account = driver.find_element(By.ID,value='u')
account.send_keys('1111111')
sleep(1)
pwd = driver.find_element(By.ID,value='p')
pwd.send_keys('*****')
sleep(2)
login_button = driver.find_element(By.ID,value='login_button')
login_button.click()
sleep(4)
driver.quit()
版权声明
本文为[qq_ thirty-six million two hundred and ninety-two thousand five]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212357006123.html
边栏推荐
- LED发光二极管的主要参数与结构介绍
- 新一代MES软件十大核心要素(下)
- 09. Raspberry pie ASP Net environment configuration
- 将node项目部署到云服务器详细教程 原创
- AI助力劳保防护装备穿戴监测,为企业安全生产保驾护航
- The most basic JDBC template and database garbled code processing
- Codesys méthode de lecture des fichiers csv (non Excel)
- Busybox overview
- OpenSSL简单的使用
- CocosCreator学习示例合集v3.4.2
猜你喜欢
随机推荐
已拿offer,面试必备知识点
小程序 分包
Main parameters and structure of LED
Detailed explanation of redis benchmark performance test tool
1.2V镍氢电池灯太阳能草坪灯升压驱动IC丝印AaTLB封装SOT23-6和SOP8单片机IC
DeepTech发布《2022先进计算七大趋势》,破局摩尔桎梏,决胜算力时代
CoDeSys method of reading CSV file (non Excel)
2022质量员-装饰方向-岗位技能(质量员)考试模拟100题模拟考试平台操作
AVL balanced binary tree and its four rotation modes
Leetcode -- character string
B. Vlad and Candies
Kubernetes deployment: offline deployment of highly available kubernetes clusters using kubespreay (scheme 1)
Cocoscreator learning sample collection v3 four point two
Application and analysis of TVS Diode
14 custom XML
架构实战训练 模块三
Share the 28 we media tools I often use and collect them quickly. If 20000 videos are played, there will be 264 benefits
Gartner发布新兴技术研究:深入洞悉元宇宙
Applet subcontracting
【无标题】2022煤炭生产经营单位(机电运输安全管理人员)上岗证题目模拟考试平台操作









