python 使用curl_cffi绕过指纹识别解决ja3指纹

初识指纹

遇到一个网站,忽然发现无论如何如何更换UA和代理请求都是403

curl_cffi 可模拟真实浏览器的 TLS | JA3 指纹。

支持JA3/TLS和http2指纹模拟;
比requests/tls_client快分开,和aiohttp/pycurl的速度比肩。

1. 安装库命令

pip install curl_cffi


 

2. 使用示例
 

from curl_cffi import requests

# Notice the impersonate parameter
r = requests.get("https://tls.browserleaks.com/json", impersonate="chrome110")

print(r.json())
# output: {..., "ja3n_hash": "aa56c057ad164ec4fdcb7a5a283be9fc", ...}
# the js3n fingerprint should be the same as target browser

# http/socks proxies are supported
proxies = {"https": "http://localhost:3128"}
r = requests.get("https://tls.browserleaks.com/json", impersonate="chrome110", proxies=proxies)

proxies = {"https": "socks://localhost:3128"}
r = requests.get("https://tls.browserleaks.com/json", impersonate="chrome110", proxies=proxies)

# 注意这个 impersonate 参数,指定了模拟哪个浏览器

curl_cffi 项目地址: https://github.com/yifeikong/curl_cffi

公众号:笔记分享社

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值