编程语言
首页 > 编程语言> > python爬取ajax

python爬取ajax

作者:互联网

import requests

url = 'https://api.bilibili.com/x/v2/reply/main?csrf=056718067a9e03b351569ee0294e4a1e&mode=3&next=2&oid=813963991&plat=1&type=1'
header = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'
}

response = requests.get(url,headers=header,verify=False)

result = response.json()

print(result['code'])

result :0

标签:python,537.36,爬取,header,ajax,result,url,requests,response
来源: https://www.cnblogs.com/java-six/p/16589680.html