python Response对象

r=requests.get("http://www.baidu.com/")

属性

r.status_code

http请求的返回状态,200表示连接成功,404表示连接失败

r.text

http响应内容的字符串形式,url对应的页面内容

r.encoding

从HTTP header中猜测的响应内容编码方式

r.apparent_encoding

从内容分析出的响应内容的编码方式(备选编码方式)

r.content

HTTP响应内容的二进制形式

r.headers

http响应内容的头部内容

posted @ 2019-06-18 14:01  pretend_smile  阅读(2810)  评论(0)    收藏  举报