Python3爬虫利器:requests的安装

388次阅读
没有评论

Python3爬虫利器:requests的安装

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。

1、相关链接

官方文档:http://cn.python-requests.org

源代码地址:https://github.com/kennethreitz/requests

下载地址:https://github.com/mozilla/geckodriver/releases  

2、利用 pip 安装

pip install requests

3、验证安装

在windows平台以管理员身份运行cmd验证安装

import requests
>>> r=requests.get("http://www.baidu.com")
>>> r.status_code
200
>>> r.encoding="utf-8"
>>> r.text

以上就是python爬虫中requests的安装过程,希望能帮助到大家安装使用哦~

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-07-18发表,共计390字。
新手QQ群:570568346,欢迎进群讨论 Python51学习