嘿,我正在尝试使用post方法请求带有参数的网站,这是网站的以下表单数据
First: name
Last: lastname
Email: email@gmail.com
CountryID: 53
City: Misgav Regional Council
Postcode: 4848484
petition_id: 613908
action: sign
Is_shared_on_fb: 0
cid: 1508
skin: community_petitions
lang: he
supports_history_api: true
secure_validation: Thu Dec 06 2018 21:45:24 GMT+0200 (Israel Standard Time)
used_js: Thu Dec 06 2018 21:45:24 GMT+0200 (Israel Standard Time)
postaction_data: eyJ1c2VyX2lkIjo5OTg0NTUwNSwic3RvcmFnZSI6eyJwb3N0YWN0aW9uX3BhZ2UiOiJwb3N0YWN0aW9uLXVzZXItcGV0aXRpb24iLCJwZXRpdGlvbklEIjoiNjEzOTA4In19
cookie_id:
问题是我不确定request()需要什么数据。我已经尝试了以下方法,但均未成功,谢谢您的帮助!
import requests
p = requests.post('https://secure.avaaz.org/he/community_petitions/brykh_bbyt_spr_hmnhlt_shl_byt_spr/?asljNcb', data={'First': 'name', 'Last': 'lastname', 'Email': 'email@gmail.com' , 'CountryID': '53', 'City': 'Misgav Regional Council' , 'PostCode': '4848484', 'petition_id': '613908', 'action': 'sign'})
print(p.text)