Requests.post()什么也不做

2024-10-01 00:22:31 发布

您现在位置:Python中文网/ 问答频道 /正文

url = 'http://tres-bien.com/iewrhdh'

header = {
'User-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.167 Chrome/64.0.3282.167 Safari/537.36'} # I'm using this to connect to the site , otherwise it's 405 Forbidden

payload = {

   'cm-name': 'Full Name' ,
   'cm-zltlkh-zltlkh': 'email@gmail.com' ,
   'cm-f-qhdyui': 'Shipping/billing address' ,
   'cm-f-qhdyud': 'Zipcode' ,
   'cm-f-qhdyuh': 'City' ,
   'cm-fo-qhdyuk': '3306989' ,
   'cm-f-qhdyuu': '0484741436' ,
   'cm-fo-qhdjlr': '3307095' 

}

# All the form that need to be fill , I used Chrome Console to see what is posted

r = requests.post(url , payload , headers=header)
print(r.text)

我只是想知道,为什么在运行这个脚本之后什么都没有提交。我错过什么了吗


Tags: thetocomhttpurlcmchromeheader