当前位置:网站首页>[爬虫]使用selenium时,躲避脚本检测
[爬虫]使用selenium时,躲避脚本检测
2022-07-07 10:33:00 【大西瓜和小栗子】
问题现象
在一次脚本尝试登陆中有一个滑块,不管怎么拖动,它都会报错误。即使是脚本填入数据,你自己拖动滑块也会一直报错。
问题解决
这个问题主要是由于应用对脚本做了检测。检测的依据是
window.navigator.webdriver
以下这张图是修改后的,没设置前都是返回true.
在请求页面的时候,先把options设置一下。以下代码只对chrome 88版以上有用。

脚本
from selenium.webdriver.chrome.options import Options
option = Options()
option.add_argument('--disable-blink-features=AutomationControlled')
web = Chrome(options=option)
web.get("https://www.baidu.com")
边栏推荐
- Baidu digital person Du Xiaoxiao responded to netizens' shouts online to meet the Shanghai college entrance examination English composition
- Zhimei creative website exercise
- 数据库系统原理与应用教程(010)—— 概念模型与数据模型练习题
- H3C HCl MPLS layer 2 dedicated line experiment
- DOM parsing XML error: content is not allowed in Prolog
- 通讯协议设计与实现
- File upload vulnerability - upload labs (1~2)
- 2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- 平安证券手机行开户安全吗?
猜你喜欢

File upload vulnerability - upload labs (1~2)

Minimalist movie website

leetcode刷题:二叉树20(二叉搜索树中的搜索)

How to use PS link layer and shortcut keys, and how to do PS layer link
![[statistical learning methods] learning notes - Chapter 5: Decision Tree](/img/0e/c60e04ab4a7ae4728cc76eff1c028a.png)
[statistical learning methods] learning notes - Chapter 5: Decision Tree

Experiment with a web server that configures its own content

Solutions to cross domain problems

Zhimei creative website exercise

Learning and using vscode

VSCode的学习使用
随机推荐
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
【深度学习】图像多标签分类任务,百度PaddleClas
SQL lab 26~31 summary (subsequent continuous update) (including parameter pollution explanation)
广州市召开安全生产工作会议
Financial data acquisition (III) when a crawler encounters a web page that needs to scroll with the mouse wheel to refresh the data (nanny level tutorial)
解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
Apache installation problem: configure: error: APR not found Please read the documentation
MPLS experiment
ENSP MPLS layer 3 dedicated line
[play RT thread] RT thread Studio - key control motor forward and reverse rotation, buzzer
Processing strategy of message queue message loss and repeated message sending
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
Is it safe to open an account in Ping An Securities mobile bank?
免备案服务器会影响网站排名和权重吗?
[statistical learning methods] learning notes - improvement methods
Inverted index of ES underlying principle
Xiaohongshu microservice framework and governance and other cloud native business architecture evolution cases
Realize a simple version of array by yourself from
Epp+dis learning road (2) -- blink! twinkle!
数据库系统原理与应用教程(009)—— 概念模型与数据模型