Python爬虫利器1:Requests库的用法
一、首先要利用pip安装Requests库
1.打开python安装目录如:F:\python2.7\Scripts
2.然后进入cmd界面
3. 输入:pip install requests 后回车,即可完成安装。
二、Rquests库的使用
1.requests库提供了http所有的基本请求方式。例如:
r = requests.get("http://httpbin.org/get") r = requests.post("http://httpbin.org/post") r = requests.put("http://httpbin.org/put") r = requests.delete("http://httpbin.org/delete") r = requests.head("http://httpbin.org/head") r = requests.options("http://httpbin.org/options")