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/

相关推荐
Wzx1980121 分钟前
Python Agent 短期记忆设计:从对话历史到 LangGraph Checkpointer
开发语言·python
ljt27249606619 分钟前
Python笔记(五)--读写文件
笔记·python
破茧蝴蝶9 小时前
Python分布式爬虫完整教程
开发语言·python
benchmark_cc9 小时前
量化系统架构设计:为什么应该将数据获取与策略逻辑解耦?
python·数据分析·pandas·量化交易·股票数据·quantdash
凤山老林9 小时前
Spring Boot 启动冲刺:耗时剖析、懒加载策略与事件驱动初始化优化
spring boot·后端·python
小白快快跑哦9 小时前
python-字符串全解(六):正则表达式-逻辑运算或
python·正则表达式·字符串·逻辑运算
Thinker QAQ10 小时前
并发编程(九):BlockingQueue 与 Channel——语言层的原子性、可见性与有序性
java·python·go·并发编程·channel·blockingqueue·message passing
道满科技10 小时前
Function Calling 参数总出错?只修参数就行
linux·windows·python
霸道流氓气质11 小时前
RAG 可观测性与生产监控实战:四层遥测模型、五大仪表盘与 OpenTelemetry 全链路追踪的 Java 生产级实现
java·人工智能·python