摘要: 如: import requestsdef down_image(): ''' demo:下载图片 ''' headers = {'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gec 阅读全文
posted @ 2020-03-21 22:27 忆梦,惊梦 阅读(409) 评论(0) 推荐(0)
摘要: 代码如下: import json import requests from requests import exceptions URL = 'https://api.github.com' def build_uri(endpoint): return '/'.join([URL,endpoin 阅读全文
posted @ 2020-03-21 21:07 忆梦,惊梦 阅读(1408) 评论(0) 推荐(0)
摘要: urllib和urllib2是相互独立的模块(原生)requests库使用了urllib3(多次请求重复使用一个socket) import requests URL_IP = 'http://httpbin.org/ip' URL_GET = 'http://httpbin.org/get' de 阅读全文
posted @ 2020-03-21 19:44 忆梦,惊梦 阅读(307) 评论(0) 推荐(0)