当前位置:网站首页>[爬虫]使用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")
边栏推荐
- leetcode刷题:二叉树24(二叉树的最近公共祖先)
- 【统计学习方法】学习笔记——提升方法
- JS to convert array to tree data
- Aike AI frontier promotion (7.7)
- 【统计学习方法】学习笔记——第四章:朴素贝叶斯法
- GCC compilation error
- Simple network configuration for equipment management
- leetcode刷题:二叉树20(二叉搜索树中的搜索)
- Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
- About sqli lab less-15 using or instead of and parsing
猜你喜欢

IPv6 experiment

跨域问题解决方案

BGP actual network configuration

OSPF exercise Report

Learning and using vscode

leetcode刷题:二叉树21(验证二叉搜索树)

Solve server returns invalid timezone Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually

About sqli lab less-15 using or instead of and parsing

How to use PS link layer and shortcut keys, and how to do PS layer link

【深度学习】图像多标签分类任务,百度PaddleClas
随机推荐
Minimalist movie website
Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
Error in compiling libssl
Xiaohongshu microservice framework and governance and other cloud native business architecture evolution cases
【PyTorch实战】用RNN写诗
Simple network configuration for equipment management
Inverted index of ES underlying principle
利用栈来实现二进制转化为十进制
OSPF exercise Report
About sqli lab less-15 using or instead of and parsing
Using stack to convert binary to decimal
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
Configure an encrypted web server
Learning and using vscode
Apache installation problem: configure: error: APR not found Please read the documentation
数据库系统原理与应用教程(011)—— 关系数据库
[statistical learning methods] learning notes - Chapter 5: Decision Tree
编译 libssl 报错
SQL Lab (46~53) (continuous update later) order by injection
SQL injection -- Audit of PHP source code (take SQL lab 1~15 as an example) (super detailed)