知名的pyspider,scrapy就不说了,今天说说这个 looter
安装
先安装好python3,需要3.6以上,然后执行 pip install looter1
2
3
4
5
6
7
8
9
10
11
12
13
14
15λ looter -h
Looter, a python package designed for web crawler lovers :)
Author: alphardex QQ:2582347430
If any suggestion, please contact me.
Thank you for cooperation!
Usage:
looter genspider <name> [--async]
looter shell [<url>]
looter (-h | --help | --version)
Options:
-h --help Show this screen.
--version Show version.
--async Use async instead of concurrent.
图片爬虫
1 | λ looter shell https://konachan.com/post |
抓取 v2
1 | import time |
抓取10页python主题的数据,按照回复数倒序排列1
2
3
4
5
6
7
8
9,author,reply,source,title
0,chinesehuazhou,127,https://www.v2ex.com/t/562327#reply127,10 行 Python 代码,批量压缩图片 500 张,简直太强大了(内有公号宣传,不喜勿进)
1,chinesehuazhou,103,https://www.v2ex.com/t/557286#reply103,len(x) 击败 x.len(),从内置函数看 Python 的设计思想(内有公号宣传,不喜勿进)
2,nfroot,73,https://www.v2ex.com/t/555249#reply73,面对 Python 的强大和难用性表示深深的迷茫,莫非打开方式不对?
3,css3,58,https://www.v2ex.com/t/554724#reply58,你们用什么工具来管理 Python 的库啊?
4,Northxw,54,https://www.v2ex.com/t/558529#reply54,花式反爬之某众点评网
5,akmonde,48,https://www.v2ex.com/t/559926#reply48,Python 项目移植到其他机器,要求全 Linux 系统适配
6,kayseen,47,https://www.v2ex.com/t/562683#reply47,这道 Python 题目有大神会做吗?
7,hellomacos,41,https://www.v2ex.com/t/562413#reply41,老生常谈的问题:如何学好 Python
公众号:苏生不惑