使用Nutch爬取指定URL列表

发布于 2025-01-02 12:52:32 字数 164 浏览 2 评论 0原文

我有一百万个 URL 列表需要获取。我使用这个列表作为 nutch 种子,并使用 Nutch 的基本 crawl 命令来获取它们。但是,我发现 Nutch 会自动获取不在列表中的 URL。我确实将爬网参数设置为-深度1 -topN 1000000。但它不起作用。有谁知道该怎么做?

I have one million URL list to fetch. I use this list as nutch seeds and use the basic crawl command of Nutch to fetch them. However, I find that Nutch automatically fetches not-on-list URLs. I do set the crawl parameters as -depth 1 -topN 1000000. But it does not work. Does anyone know how to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

走过海棠暮 2025-01-09 12:52:32

nutch-site.xml 中设置此属性。 (默认情况下为 true,因此它将外链接添加到crawldb)

<property>
  <name>db.update.additions.allowed</name>
  <value>false</value>
  <description>If true, updatedb will add newly discovered URLs, if false
  only already existing URLs in the CrawlDb will be updated and no new
  URLs will be added.
  </description>
</property>

Set this property in nutch-site.xml. (by default its true so it adds outlinks to the crawldb)

<property>
  <name>db.update.additions.allowed</name>
  <value>false</value>
  <description>If true, updatedb will add newly discovered URLs, if false
  only already existing URLs in the CrawlDb will be updated and no new
  URLs will be added.
  </description>
</property>
烟雨凡馨 2025-01-09 12:52:32
  • 删除爬网和 urls 目录(如果之前已创建)
  • 创建并更新种子文件(其中列出 URL 每行 1URL)
  • 重新启动爬网过程

命令

nutch crawl urllist -dir crawl -depth 3 -topN 1000000
  • urllist - 种子文件(url 列表)所在的目录
  • crawl - 目录名称

即使问题仍然存在,请尝试删除您的 nutch 文件夹并重新启动整个过程。

  • Delete the crawl and urls directory (if created before)
  • Create and Update the seed file ( where URLs are listed 1URL per row)
  • Restart the crawling process

Command

nutch crawl urllist -dir crawl -depth 3 -topN 1000000
  • urllist - Directory where seed file (url list) is present
  • crawl - Directory name

Even if the problem persists, try to delete your nutch folder and restart the whole process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文