-
pip install curl_cffi
-
使用
from curl_cffi import requests
# impersonate参数指定了模拟浏览器的型号
res = requests.get("https://tls.browserleaks.com/json", impersonate="chrome101")
print(res.json()) -
补充
# 当前可模拟浏览器型号
edge99 = "edge99"
edge101 = "edge101"
chrome99 = "chrome99"
chrome100 = "chrome100"
chrome101 = "chrome101"
chrome104 = "chrome104"
chrome107 = "chrome107"
chrome110 = "chrome110"
chrome99_android = "chrome99_android"
safari15_3 = "safari15_3"
safari15_5 = "safari15_5" - 拓展:pyhttpx、pycurl