web-crawler - 如何在 StormCrawler 中将 URL 作为文本文件播种?
问题描述
我有许多需要使用 StormCrawler 抓取的 URL(大约 40,000 个)。有什么方法可以将这些 URL 作为文本文件而不是crawler.flux中的列表传递?像这样的东西:
spouts:
- id: "spout"
className: "com.digitalpebble.stormcrawler.spout.MemorySpout"
parallelism: 1
constructorArgs:
- "URLs.txt"
解决方案
对于 Solr 和 Elasticsearch,有一些注入器可以从文件中读取 URL,并将它们作为 DISCOVERED 项添加到状态索引中。当然,需要使用 Solr 或 Elasticsearch 来保存状态索引。注入器作为拓扑启动,例如。
storm ... com.digitalpebble.stormcrawler.elasticsearch.ESSeedInjector .../seeds '*' -conf ...
推荐阅读
- angular - Bootstrap 3.4 版在 Angular 9 中不起作用
- android - 多个项目的 .notifyItemInserted() 的替代方法是什么?
- google-chrome - 在 Appium 1.15.1 中设置 android chrome 浏览器的正确功能是什么?
- c# - 嵌套的 3 级 LINQ 查询
- elasticsearch - 使用 logstash 对弹性搜索字段进行排序
- go - Sarama 无法为 Amazon MSK 版本 2.3.1 生成消息
- boolean-logic - 简化布尔表达式:X + X'Y'Z
- amazon-web-services - Lambda@Edge 中的 DynamoDB 访问
- javascript - JS 脚本可以阻塞整个服务器吗?如果是这样,我怎么可能摆脱这种攻击?
- sql - SQL 中基于所选选项的条件 Where 子句