随笔分类 -  requests

摘要:1 import unittest 2 import requests 3 import urllib3 4 urllib3.disable_warnings() 5 import warnings # 解决错误 ResourceWarning: Enable tracemalloc to get 阅读全文
posted @ 2021-05-17 16:47 Aliwall 阅读(486) 评论(0) 推荐(0)
摘要:# 字典传参 token = 'ajkdakkfweids' name = "Jack" body = { 'aaa': '123', 'bbb': '567', 'token': token, #直接用变量代替参数, 注意参数是不需要引号的 'user': 'userid%s' %name # 参 阅读全文
posted @ 2021-05-17 16:40 Aliwall 阅读(152) 评论(0) 推荐(0)
摘要:unittest requests 在添加了以下代码依然出现以下错误: 1 import urllib3 2 urllib3.disable_warnings() InsecureRequestWarning: Unverified HTTPS request is being made. Addi 阅读全文
posted @ 2021-05-14 22:23 Aliwall 阅读(329) 评论(0) 推荐(0)
摘要:unittest 使用 requests 发请求 遇到如下错误: ResourceWarning: Enable tracemalloc to get the object allocation traceback代码中添加以下红色代码即可. 1 import warnings 2 3 def se 阅读全文
posted @ 2021-05-14 22:14 Aliwall 阅读(2167) 评论(0) 推荐(0)
摘要:使用 python requests 遇到以下错误: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif 阅读全文
posted @ 2021-05-14 12:05 Aliwall 阅读(1070) 评论(0) 推荐(0)
摘要:1 # -*-coding:utf-8 -*- 2 3 import random 4 5 # 返回一个随机的请求头 headers 6 def getheaders(): 7 # 各种PC端 8 user_agent_list_2 = [ 9 # Opera 10 "Mozilla/5.0 (Wi 阅读全文
posted @ 2019-08-16 22:58 Aliwall