requests库的用法

import requests

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

 

详细用法请参见

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

https://www.cnblogs.com/mzc1997/p/7813801.html

猜你喜欢

转载自www.cnblogs.com/qmjy/p/11360391.html