我是Nutch的新手.我需要抓取网页(比如几百个网页),阅读已抓取的数据并进行一些分析.
我按照链接https://wiki.apache.org/nutch/NutchTutorial(并集成了Solr,因为我将来可能需要搜索文本)并使用一些URL作为种子运行爬网.
现在,我text/html在本地机器上找不到数据.我在哪里可以找到数据以及以文本格式读取数据的最佳方式是什么?
爬网结束后,您可以使用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
Run Code Online (Sandbox Code Playgroud)
例如,你可以做类似的事情
$ bin/nutch dump -segment crawl/segments -outputDir crawl/dump/
Run Code Online (Sandbox Code Playgroud)
这将在-outputDir位置创建一个新目录,并转储以html格式抓取的所有页面.
还有很多方法可以从Nutch中转出特定的数据,看看https://wiki.apache.org/nutch/CommandLineOptions
| 归档时间: |
|
| 查看次数: |
4452 次 |
| 最近记录: |