Selenium 被反爬 报400 打不开

直接使用第三方开源的driver undetected-chromedriver

开源地址:https://github.com/ultrafunkamsterdam/undetected-chromedriver

它自带一些常见的因为浏览器环境问题被反爬的反反爬配置,可以规避部分风控。

使用

1、安装依赖

python 复制代码
pip install undetected-chromedriver

2、替换原生的Selenium

python 复制代码
import undetected_chromedriver as uc
driver = uc.Chrome(headless=True,use_subprocess=False)
driver.get('https://nowsecure.nl')
driver.save_screenshot('nowsecure.png')

完成

经测试,某知识产权网可用

附带浏览器环境检测网址:https://bot.sannysoft.com/

相关推荐
Actinen14 分钟前
【Python】——注释
python
自动化小秋葵40 分钟前
Python入门经典题目
开发语言·python
while(1){yan}1 小时前
数据结构之堆
数据结构·python·算法
深蓝电商API1 小时前
反爬升级:WAF、行为检测、指纹追踪,我们该如何应对?
爬虫·waf·反爬
凌晨一点的秃头猪1 小时前
Python 常见 bug 总结和异常处理
开发语言·python·bug
mortimer1 小时前
用PySide6 构建一个响应式视频剪辑工具:多线程与信号机制实战
python·ffmpeg·pyqt
新子y1 小时前
【小白笔记】input() 和 print() 这两个函数
笔记·python
文火冰糖的硅基工坊2 小时前
[人工智能-大模型-72]:模型层技术 - 模型训练六大步:①数据预处理 - 基本功能与对应的基本组成函数
开发语言·人工智能·python
Python×CATIA工业智造4 小时前
Pycatia二次开发基础代码解析:组件识别、选择反转与链接创建技术解析
python·pycharm
小宁爱Python4 小时前
从零搭建 RAG 智能问答系统 6:Text2SQL 与工作流实现数据库查询
数据库·人工智能·python·django