不一定非要用selenium的
你试试这个代码 看看能不能拿到数据
import requests
url='https://www.toutiao.com/api/pc/feed/?'
headers={
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
}
params={
'min_behot_time': '0',
'refresh_count': '1',
'category': 'news_tech',
'utm_source': 'toutiao',
'widen': '1',
'tadrequire': 'true',
'_signature': '_02B4Z6wo00d01eDWtRwAAIDCJl-taOBJ2t3g8rGAABjn6cxBkgtLHOzFJDtYU3VcM3cwz7YTApRXybmmU.YUUyEYXOEM4BNeozIGE.z4PkW17XPWjlbWGm5GC315aHiR6t3KAXnWcmprpg2.f1'
}
res=requests.get(url=url,headers=headers,params=params)
print(res.json())
|