一、网络爬虫规则

1、Requests库: requests.request(method,url,**kwargs)

Python学习笔记-网络爬虫(一、规则)

r = requests.get(url)

Python学习笔记-网络爬虫(一、规则)

爬取网页的通用代码框架(考虑错误的处理)

Python学习笔记-网络爬虫(一、规则)

HTTP

Python学习笔记-网络爬虫(一、规则)

Python学习笔记-网络爬虫(一、规则)

2、网络爬虫“盗亦有道”

Python学习笔记-网络爬虫(一、规则)

Python学习笔记-网络爬虫(一、规则)

Python学习笔记-网络爬虫(一、规则)

3、Requests库网络爬虫实例

京东商品信息爬取

Python学习笔记-网络爬虫(一、规则)

亚马逊商品信息爬取(亚马逊对爬虫限制,要修改html头信息)

Python学习笔记-网络爬虫(一、规则)

百度搜索提交(百度搜索API:http://www.baidu.com/s?wd=keyword)

(360搜索API:http://www.so.com/s?q=keyword)

Python学习笔记-网络爬虫(一、规则)

网络图片的爬取(视频同理)

Python学习笔记-网络爬虫(一、规则)

(全代码)

Python学习笔记-网络爬虫(一、规则)

IP地址归属地的查询(在www.ip138.com上,试一下可知查询API)

Python学习笔记-网络爬虫(一、规则)

相关文章: