requests库的用法

import requests

headers = {"headers头部文件"}
url = 'http://www.baidu.com/'
html = requests.get(url,headers=headers)
html.encoding = 'gbk' #转成该网站的格式

html.text#很重要
print(html.text)

 

详细用法请参见

↓↓↓↓↓↓↓↓↓↓↓↓↓↓

这位大神的博客

原文地址:https://www.cnblogs.com/qmjy/p/11360391.html