1
import requests
import json
headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36'}
post_data={"q":"","filters":{"sizes":["Large","MNE"],"sectors":[18],"countries":[228],"regions":["Northern America"],"years":[2015],"types":[]},"page":1}
with requests.Session() as s:
for_cookies=s.get('http://database.globalreporting.org/search')
# print(for_cookies.content)
p = s.post('http://database.globalreporting.org/search/ajax/',data=json.dumps(post_data), headers=headers)
print(p.content)
我的鉻可以訪問網站,但我的代碼不能。如何讓我的代碼能夠訪問該網站? 403禁止並且CSRF驗證失敗。請求中止。蟒蛇的請求
你沒有發送csrf令牌 –