标签:pac port 问题 图片 get 代码 class code 参数
import requests url = ‘https://mip.tutumanhua.com/‘ headers = { ‘User-Agent‘:‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36‘ } res = requests.get(url=url,headers=headers) print(res)
import requests url = ‘https://mip.tutumanhua.com/‘ headers = { ‘User-Agent‘:‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36‘ } #出现SSLError -->证书验证有问题,添加verify参数为False,禁止证书验证,就不会抛异常了 res = requests.get(url=url,headers=headers,verify=False) print(res)
import requests url = ‘https://mip.tutumanhua.com/‘ headers = { ‘User-Agent‘:‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36‘ } #即使添加了verify参数,但是还以产生警告,下面这行代码避免产生警告的 requests.packages.urllib3.disable_warnings() #出现SSLError -->证书验证有问题,添加verify参数为False,禁止证书验证,就不会抛异常了 res = requests.get(url=url,headers=headers,verify=False) print(res)
标签:pac port 问题 图片 get 代码 class code 参数
原文地址:https://www.cnblogs.com/u-damowang1/p/12785675.html