SE::Dogpile::Images - Dogpile 图片爬虫工具

爬虫工具概览
Dogpile 搜索结果图片爬虫工具。通过 SE::Dogpile::Images 爬虫工具,您可以获取图片链接库或可供进一步使用的图片。您可以直接使用在 Dogpile 搜索栏中输入的查询语句。
A-Parser 的功能允许您保存 Dogpile 爬虫工具的数据抓取设置以供将来使用(预设),设置数据抓取计划等等。您可以使用自动查询扩展、从文件替换子查询、遍历数字字母组合和列表,以获取尽可能多的结果。
由于内置了强大的 Template Toolkit 模板引擎,您可以按所需的格式和结构保存结果,该引擎允许对结果应用额外的逻辑并以各种格式输出数据,包括 JSON、SQL 和 CSV。
爬虫工具应用案例
通过链接下载图片
A-Parser 允许使用任务链,在第一个任务完成后,第二个任务将开始执行,第一个任务中的链接将作为第二个任务的查询。
下载示例
eJyNVktT2zAQ/iuMhkNoQ2IOvfjCBGimdCihEE4hnVHjtSuQJSPJAcbkv3dXNn6k
JvRmrfa9335ywRy3D/bKgAVnWbgoWOa/WcjOdJIJCXvnKU9gL9JPSmoegWFDlnFj
wZD+gt18DcNKNQy9rkWNCGKeS8eWyyFDh/hpp9qknBzvZ0ejKkp9ecPXMNd4GaOf
RjzF0yVPgawi7oBuR7F3NDgYuWfywKNIOKEVl2UESquJeqvEY0721hmhEtTHoxFg
p0anKHbgnZDw5S3DBdv3Z4Zucm//s7RhYcylhSGzmO6UYzLR9o1wYLjTZpZRTigv
mFYTKS9gDbJR8/5PciGxoXYSo9F5ZdivMvvHx6YusR1qDebJYA61F386mf1orCJ9
oROsPPqNdUuRCodne6pzRcMJUPgAkNV9u9QoSbWBOowzOdTBEToZqAgVm6lNskbU
qaIzma5wpVUskhnmb0QEb5q5miM+Z+pUp5kEKouVENs7a+Mxt3DdAGZiq6HQoU53
29WpD0h9qKA6ZE5rab/flIlnRiAev1C6Kba1nUPV2hWX8vb6opNdgy/yrBNYaaEY
6TpINEIK69oMi84GXYILw2/z+VVrb1DFQALP6AU740C5Q/eSQTj6dCyoAeNBppLX
+wyOk9dExAe++ag/RyW0EbQXxvCXanmouPJmlVun07Jb9cRQ/ge4H8abqHIUS97a
UloN2hdfwppLDxClFTT+cUOdn4n2cKHFA2XbkcqFK/WqKEo7eMy5ZJs2XzS770u2
43IrRypPD/eL6hsVNiNilNJtD2JULuU7QO/DcC89/A96doIwaPZO6Q9Ja5sN30Fa
G1T9NIucyXuWsGBW52ZFbkqiI+zTcKmdbDmssTceLH6Nl58P7u5Gg+OwC7n9HsxV
ICjNN8th85r0rW0PXWzRbdBHRvVm9rBw0N6/7ZXusFjwDhFtvxt+XB+xerCb0bev
O2webPo4JtjxJvVz5a7HIGg/BBTQzwB7fuSHVJJR/RdQ9D7qYYF2DVfhEc/39qo0
JphXOhjW+tU/2vwFUiDnrA==
采集的数据
- 图片链接
- 页面链接
- 高度和宽度
- 预览图链接

应用场景
- 采集图片用于填充个人博客
- 采集图片用于填充个人网站
- 采集头像库
查询
应指定搜索词作为查询,例如:
Remington
Tiger
Romeo and Juliet
Quantum mechanics
查询宏
您可以使用内置宏来扩展查询,例如我们想要获取一个非常庞大的论坛数据库,指定几个不同语言的核心查询:
forum
论坛
foro
论坛
在查询格式中指定从 a 到 zzzz 的字符遍历,此方法可以最大程度地轮换搜索结果并获得许多新的唯一结果:
$query {az:a:zzzz}
该宏将为每个原始搜索查询创建 475254 个额外查询,总计 4 x 475254 = 1901016 个搜索查询,这个数字令人印象深刻,但对于 A-Parser 来说完全不是问题。在每分钟 2000 个查询的速度下,此类任务仅需 16 小时即可处理完毕。
结果输出选项
A-Parser 凭借内置的 Template Toolkit 模板引擎支持灵活的结果格式化,这使其能够以任意形式以及结构化形式(如 CSV 或 JSON)输出结果。
默认输出
结果格式:
$serp.format('$link\n')
结果示例:
http://crossexamined.org/wp-content/uploads/2014/06/Quantum_Computer.jpg
https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Hydrogen_Density_Plots.png/1200px-Hydrogen_Density_Plots.png
http://3.bp.blogspot.com/-7mo9xgi0zZ0/VDcYLKYsZmI/AAAAAAAABc8/toMaFUqtcEc/s1600/24854-quantum-mechanics.jpg
http://4.bp.blogspot.com/-FnufNdvAIAI/T6GAIsE9QrI/AAAAAAAADgs/ini4LJG_Nes/s1600/A+Mass+&+Energy.jpg
http://40.media.tumblr.com/tumblr_ma6rb5smWd1rx06nvo1_1280.jpg
https://media.buzzle.com/media/images-en/gallery/education/physics/1200-261760-basics-of-quantum-mechanics.jpg
https://wonderopolis.org/wp-content/uploads/2017/03/Quantum_Physicsdreamstime_xxl_60222747.jpg
https://cdn.wallpapersafari.com/20/6/FkmvcC.gif
https://media.buzzle.com/media/images-en/gallery/education/chemistry/1200-96168909-atoms-emit-light.jpg
http://www.therealityfiles.com/wp-content/uploads/2014/12/quantum_mechanics.jpg
http://i.dailymail.co.uk/i/pix/2010/03/18/article-1258932-014CFA7D000004B0-375_468x462.jpg
https://cdn.wallpapersafari.com/7/34/jXU8Ay.gif
http://mednorthwest.com/wp-content/uploads/2015/09/Quantum-entanglement-wave-particle.jpg
http://steve-patterson.com/wp-content/uploads/2015/02/QuantumPhysics2.jpg
http://cdn1.collective-evolution.com/assets/uploads/2016/07/QuantumPhysics-759x500.jpg
输出到 CSV 表格
结果格式:
[% FOREACH item IN serp;
tools.CSVline(query, item.link, item.width, item.height, item.page, item.thumb);
END %]
结果示例:
cats,https://cdn2.theweek.co.uk/sites/theweek/files/2017/11/131117-wd-cats.jpg,1400,788,https://www.theweek.co.uk/94877/why-are-so-many-australian-towns-introducing-cat-curfews,https://tse3.mm.bing.net/th?id=OIP.iYyPimFLj1_wgKEsTsggQgHaEK&pid=Api
cats,http://mymodernmet.com/wp/wp-content/uploads/2017/03/gabrielius-khiterer-stray-cats-8.jpg,750,1028,https://mymodernmet.com/gabrielius-khiterer-stray-cat-photos/,https://tse2.mm.bing.net/th?id=OIP.ZjfS8JQc9sahsK0-w8dRFAHaKJ&pid=Api
cats,https://www.israelhayom.com/wp-content/uploads/2020/04/why-cats-are-best-pets-worshipped-animals-1559234295.jpg,2119,1415,https://www.israelhayom.com/2020/04/23/2-nyc-cats-test-positive-for-coronavirus-officials-recommend-pet-precautions/,https://tse1.mm.bing.net/th?id=OIP.U7274nc_llbuQTChXpKVNgHaE8&pid=Api
cats,http://fishsubsidy.org/wp-content/uploads/2020/01/abyssinian-cats.jpg,1204,1445,http://fishsubsidy.org/category/cat/cat-breeds/,https://tse3.mm.bing.net/th?id=OIP.uHEu4-5TLJ6SSgDree6ahQHaI4&pid=Api
cats,https://external-preview.redd.it/gxbKXOj-OF1_RSHa7Ncp8Gs_OFFP5i6V7SU5DPT2t1E.jpg?auto=webp&s=b6e85ba0f1517dc629d21208a7d9db992d550ba9,1920,2560,https://www.reddit.com/r/cats/comments/2k2pio/my_very_ugly_cat/,https://tse1.mm.bing.net/th?id=OIP.t2BxlpEwcGrXJJQSToWVBAHaJ4&pid=Api
cats,http://www.zastavki.com/pictures/originals/2013/Animals_Cats_Sleeping_gray_kitten_036760_.jpg,2560,1600,http://www.zastavki.com/eng/Animals/Cats/wallpaper-36760.htm,https://tse4.mm.bing.net/th?id=OIP.3c_ISLWidlMWXHfjqkpB2wHaEo&pid=Api
cats,https://d.ibtimes.co.uk/en/full/1457779/cats-dont-need-owners.jpg,720,1280,https://www.ibtimes.co.uk/cats-prefer-their-owners-other-people-dont-need-them-feel-safe-1518912,https://tse1.mm.bing.net/th?id=OIP.COdza3KGEWHT3uo9gJ5-0QCoEs&pid=Api
cats,https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/reference_guide/why_cats_sneeze_ref_guide/1800x1200_why_cats_sneeze_ref_guide.jpg,1800,1200,https://pets.webmd.com/cats/why-cats-sneeze,https://tse4.mm.bing.net/th?id=OIP.6C8jTceMZG78kseu8RUyfAHaE8&pid=Api
cats,http://mcdaniel.hu/wp-content/uploads/2015/01/6784063-cute-cats-hd.jpg,2560,1600,http://mcdaniel.hu/cat-adoption-101/,https://tse4.mm.bing.net/th?id=OIP.QdEkrZjd1c_VN_aUtleoFgHaEo&pid=Api
保存为 SQL 格式
结果格式:
[% FOREACH serp;
"INSERT INTO serp VALUES('" _ query _ "', '"; link _ "', '"; page _ "', '"; thumb _ "')\n";
END %]
结果示例:
INSERT INTO serp VALUES('cats', 'https://viralcats.net/blog/wp-content/uploads/2017/12/Mean-looking-cat-Viral-Cats-03.jpg', 'https://viralcats.net/blog/2017/12/30/10-kitties-that-you-dont-want-to-mess-with/', 'https://tse2.mm.bing.net/th?id=OIP.AdkhgipoWbJwiQBp9VIWpgAAAA&pid=Api')
INSERT INTO serp VALUES('cats', 'http://mymodernmet.com/wp/wp-content/uploads/2017/03/gabrielius-khiterer-stray-cats-8.jpg', 'https://mymodernmet.com/gabrielius-khiterer-stray-cat-photos/', 'https://tse2.mm.bing.net/th?id=OIP.ZjfS8JQc9sahsK0-w8dRFAHaKJ&pid=Api')
INSERT INTO serp VALUES('cats', 'http://fishsubsidy.org/wp-content/uploads/2020/01/abyssinian-cats.jpg', 'http://fishsubsidy.org/category/cat/cat-breeds/', 'https://tse3.mm.bing.net/th?id=OIP.uHEu4-5TLJ6SSgDree6ahQHaI4&pid=Api')
INSERT INTO serp VALUES('cats', 'https://cdn2.theweek.co.uk/sites/theweek/files/2017/11/131117-wd-cats.jpg', 'https://www.theweek.co.uk/94877/why-are-so-many-australian-towns-introducing-cat-curfews', 'https://tse3.mm.bing.net/th?id=OIP.iYyPimFLj1_wgKEsTsggQgHaEK&pid=Api')
INSERT INTO serp VALUES('cats', 'https://www.israelhayom.com/wp-content/uploads/2020/04/why-cats-are-best-pets-worshipped-animals-1559234295.jpg', 'https://www.israelhayom.com/2020/04/23/2-nyc-cats-test-positive-for-coronavirus-officials-recommend-pet-precautions/', 'https://tse1.mm.bing.net/th?id=OIP.U7274nc_llbuQTChXpKVNgHaE8&pid=Api')
INSERT INTO serp VALUES('cats', 'https://s-i.huffpost.com/gen/964776/images/o-CATS-KILL-BILLIONS-facebook.jpg', 'https://www.huffingtonpost.com/2013/01/30/domestic-cats-kill-billions-mice-birds-annually-study_n_2575833.html', 'https://tse1.mm.bing.net/th?id=OIP.ETFxELWtgKQwMlcoccq-SAHaHa&pid=Api')
将结果转储为 JSON
通用结果格式:
[% IF notFirst;
",\n";
ELSE;
notFirst = 1;
END;
obj = {};
obj.query = query;
obj.images = [];
FOREACH item IN p1.serp;
obj.images.push({
width = item.width
height = item.height
link = item.link
page = item.page
thumb = item.thumb
});
END;
obj.json %]
起始文本:
[
结束文本:
]
结果示例:
[{
"images": [
{
"link": "https://viralcats.net/blog/wp-content/uploads/2017/12/Mean-looking-cat-Viral-Cats-03.jpg",
"width": "462",
"page": "https://viralcats.net/blog/2017/12/30/10-kitties-that-you-dont-want-to-mess-with/",
"thumb": "https://tse2.mm.bing.net/th?id=OIP.AdkhgipoWbJwiQBp9VIWpgAAAA&pid=Api",
"height": "722"
},
{
"link": "http://mymodernmet.com/wp/wp-content/uploads/2017/03/gabrielius-khiterer-stray-cats-8.jpg",
"width": "750",
"page": "https://mymodernmet.com/gabrielius-khiterer-stray-cat-photos/",
"thumb": "https://tse2.mm.bing.net/th?id=OIP.ZjfS8JQc9sahsK0-w8dRFAHaKJ&pid=Api",
"height": "1028"
},
{
"link": "http://fishsubsidy.org/wp-content/uploads/2020/01/abyssinian-cats.jpg",
"width": "1204",
"page": "http://fishsubsidy.org/category/cat/cat-breeds/",
"thumb": "https://tse3.mm.bing.net/th?id=OIP.uHEu4-5TLJ6SSgDree6ahQHaI4&pid=Api",
"height": "1445"
},
],
"query": "cats"
}]
要在任务编辑器中使用“Prepend text”和“Append text”选项,需要激活“More options”。
可用设置
| 参数 | 默认值 | 描述 |
|---|---|---|
| Pages count | 5 | 要抓取的页数 |
| Util::ReCaptcha2 preset | default | 确定是否使用 Util::ReCaptcha2 来绕过验证码 |
| ReCaptcha2 retries | 3 | 在不更换代理的情况下,尝试发送 ReCaptcha 响应的指定次数 |
