2018-11-14答疑

request.get(url)的作用是否只是可以得到网站的响应内容?
request.post(url,data)中data参数的作用? 返回的信息是?

import requests

response = requests.get('http://www.baidu.com')
print(response.url)
print(response.headers)#打印头信息
print(response.cookies)
print(response.text)#打印网页源码
print(response.content)

response = requests.post('http://www.baidu.com')
print(response)
print(response.url)
print(response.headers)#打印头信息
print(response.cookies)
print(response.text)#打印网页源码
print(response.content)

你可能感兴趣的:(2018-11-14答疑)