网页POST, 用form表单提交,报错报了一堆
为什么我用自己写的表单提交,却报错了。原代码:
——————————————————————————————————————————————
import requests
url = 'https://my.hrdantwerp.com/?'
data = {'id':' 34','record_number':' 180000008959','L':' '}
r =requests.post(url,data)
print(r.text)
——————————————————————————————————————
url = 'https://my.hrdantwerp.com/?'
headers = {'user-agnet': 'firefox'}
data = {'id': '34', 'record_number': '180000008959', 'L': ''}
r = requests.post(url, headers=headers, data=data, verify=False)
print(r.text) ……说实话没看懂你的意思 哥 ,报错的话行不行把报错内容先发出来,这才是最主要的啊我们根据报错内容看你上面代码的问题 。。。晕 刚刚试着运行了下你的代码,返回的错误是:
requests.exceptions.SSLError
这说明是证书错误,你post请求里面增加一个 verify = False 的选项,跳过证书验证即可
r =requests.post(url,data,verify = False)
Twilight6 发表于 2020-5-23 19:26
刚刚试着运行了下你的代码,返回的错误是:
这说明是证书错误,你post请求里面增加一个 verify = False...
InsecureRequestWarning,
InsecureRequestWarning: Unverified HTTPS request is being made to host 'my.hrdantwerp.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings xiaosi4081 发表于 2020-5-23 19:29
InsecureRequestWarning,
InsecureRequestWarning: Unverified HTTPS request is being made to hos ...
运行之后要稍等15秒左右,这个网站返回数据太慢了 Twilight6 发表于 2020-5-23 19:36
运行之后要稍等15秒左右,这个网站返回数据太慢了
怎么做?
xiaosi4081 发表于 2020-5-23 19:38
怎么做?
运行之后等待即可,红色的字只是警告 xiaosi4081 发表于 2020-5-23 19:29
InsecureRequestWarning,
InsecureRequestWarning: Unverified HTTPS request is being made to hos ...
提问的是小号? suchocolate 发表于 2020-5-23 23:52
提问的是小号?
????
页:
[1]