1 requests库的安装
requests库的安装
Pip install requests (anaconda第三方库中已安装requests库)
测试:
"""requests库的安装测试""" import requests r = requests.get("https://www.baidu.com/") # 输出状态码 print(r.status_code) # 200 # utf-8编码方式 r.encoding = 'utf-8' print(r.text)
![](https://img2020.cnblogs.com/blog/2049048/202006/2049048-20200604091518034-2041997222.png)
requests库的安装
Pip install requests (anaconda第三方库中已安装requests库)
测试:
"""requests库的安装测试""" import requests r = requests.get("https://www.baidu.com/") # 输出状态码 print(r.status_code) # 200 # utf-8编码方式 r.encoding = 'utf-8' print(r.text)
![](https://img2020.cnblogs.com/blog/2049048/202006/2049048-20200604091518034-2041997222.png)