gpt4 book ai didi

web-crawler - 运行nutch爬虫时爬取的数据存放在哪里?

转载 作者:行者123 更新时间:2023-12-04 23:20:06 24 4
gpt4 key购买 nike

我是 Nutch 的新手。我需要抓取网页(比如几百个网页),读取抓取的数据并进行一些分析。

我点击了链接 https://wiki.apache.org/nutch/NutchTutorial (并且集成了 Solr,因为我将来可能需要搜索文本)并使用几个 URL 作为种子运行爬网。

现在,我没有找到 text/html我本地机器上的数据。在哪里可以找到数据以及以文本格式读取数据的最佳方法是什么?

版本

  • apache-nutch-1.9
  • solr-4.10.4
  • 最佳答案

    抓取结束后,您可以使用 bin/nutch dump 命令转储以纯 html 格式获取的所有 url。

    用法如下:

    $ bin/nutch dump [-h] [-mimetype <mimetype>] [-outputDir <outputDir>]
    [-segment <segment>]
    -h,--help show this help message
    -mimetype <mimetype> an optional list of mimetypes to dump, excluding
    all others. Defaults to all.
    -outputDir <outputDir> output directory (which will be created) to host
    the raw data
    -segment <segment> the segment(s) to use

    所以例如你可以做类似的事情
    $ bin/nutch dump -segment crawl/segments -outputDir crawl/dump/

    这将在 -outputDir 位置创建一个新目录并转储以 html 格式抓取的所有页面。

    从 Nutch 转储特定数据的方法还有很多,请查看 https://wiki.apache.org/nutch/CommandLineOptions

    关于web-crawler - 运行nutch爬虫时爬取的数据存放在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29342945/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com