r = requests.get('www.baidu.com') r.request.headers{'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} #获取头部信息 kv = {'user-agent':'Mozilla/5.0'} r = requests.get('www.baidu.com',he…