python抓取页面遇到405处理
Response 405 using Python Requests
The following code is working for me:
import requests
url = 'https://peepoo.gq/sign'
payload = {'content' : 'pickle rick'}
headers = {
'content-type' : 'application/x-www-form-urlencoded',
}
params = {'guestbook_name' : 'main'}
r = requests.post(url, data=payload, headers=headers, params=params, allow_redirects=True)
If you read the error description, it actually says the reason.
"The method POST is not allowed for this resource."