application/x-www-form-urlencoded 与 multipart/form-data 的区别
https://www.cnblogs.com/mlllily/p/14554907.html
利用 requests_toolbelt 解决
How to send form-data using python requests?
pip3 install requests_toolbelt
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
clave_elector = "ABCDEF01234567H400"
numero_emision = "01"
ocr = "1234567846570"
modelo = "a"
data_0 = {
"claveElector": clave_elector,
"numeroEmision": numero_emision,
"ocr": ocr,
"modelo": modelo,
"g-recaptcha-response": ''
}
data = MultipartEncoder(fields = data_0)
headers = {
'Content-type': data.content_type
}
response = requests.post(
'https://listanominal.ine.mx/scpln/resultado.html',
data = data,
headers = headers
)
print(response.text)
标签:form,python,toolbelt,headers,requests,ocr,data
From: https://www.cnblogs.com/twopics/p/18214053