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响应内容的头部内容

 

相关文章:

  • 2021-11-30
  • 2021-11-30
  • 2022-12-23
  • 2022-02-09
  • 2021-07-20
  • 2021-11-30
猜你喜欢
  • 2022-02-06
  • 2022-12-23
  • 2021-12-19
  • 2021-12-30
  • 2021-07-21
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案