目录Requests库入门Requests库安装HTTP协议Requests库方法爬取网页的通用代码框架Requests库实战 Requests库入门 Requests库安装 pip install requests Requests库的安装测试: >>> import requests >>> r = requests.get("http://www.baidu.com") >>> r.status_code 200 >>> r.encoding = 'utf-8' #修改默认编码 >>> r.text #打印网页内容 HTTP协议 HTTP,Hypertext Transfer P