Nutch 不抓取 seed.txt 中指定的网址以外的网址
Nutch not crawling URLs except the one specified in seed.txt
我正在使用 Apache Nutch 1.12,我尝试抓取的 URLs 类似于 https://www.mywebsite.com/abc-def/,这是我的 seed.txt 文件中的唯一条目。因为我不希望抓取 URL 中没有 "abc-def" 的任何页面,所以我在 regex-urlfilter.txt 中添加了以下行:
+^https://www.mywebsite.com/abc-def/(.+)*$
当我尝试 运行 以下爬网命令时:
**/bin/crawl -i -D solr.server.url=http://mysolr:3737/solr/coreName $NUTCH_HOME/urls/ $NUTCH_HOME/crawl 3**
它只抓取和索引一个 seed.txt url 并且在第二次迭代中它只是说:
Generator: starting at 2017-02-28 09:51:36
Generator: Selecting best-scoring urls due for fetch.
Generator: filtering: false
Generator: normalizing: true
Generator: topN: 50000
Generator: 0 records selected for fetching, exiting ...
Generate returned 1 (no new segments created)
Escaping loop: no more URLs to fetch now
当我更改 regex-urlfilter.txt 以允许一切 (+.) 它开始为 https://www.mywebsite.com 上的每个 URL 建立索引,这当然是我不想要的。
如果有人碰巧遇到同样的问题,请分享你是如何克服它的。
您可以尝试调整 conf/nutch-default.xml 中可用的属性。也许控制您想要的外链数量或修改获取属性。如果您决定覆盖任何 属性,请将该信息复制到 conf/nutch-site.xml 并将新值放在那里。
在最后 2 次中尝试了多种方法后,得到了解决方案 days.Here 是解决方案:
由于我抓取的网站很重,nutch-default.xml中的属性将其截断为65536字节(默认)。不幸的是我想抓取的链接没有得到包含在所选部分中,因此 nutch 没有爬行 it.When 我通过将以下值放在 nutch-site.xml 中将其更改为无限制,它开始爬行我的页面:
<property>
<name>http.content.limit</name>
<value>-1</value>
<description>The length limit for downloaded content using the http://
protocol, in bytes. If this value is nonnegative (>=0), content longer
than it will be truncated; otherwise, no truncation at all. Do not
confuse this setting with the file.content.limit setting.
</description>
</property>
我正在使用 Apache Nutch 1.12,我尝试抓取的 URLs 类似于 https://www.mywebsite.com/abc-def/,这是我的 seed.txt 文件中的唯一条目。因为我不希望抓取 URL 中没有 "abc-def" 的任何页面,所以我在 regex-urlfilter.txt 中添加了以下行:
+^https://www.mywebsite.com/abc-def/(.+)*$
当我尝试 运行 以下爬网命令时:
**/bin/crawl -i -D solr.server.url=http://mysolr:3737/solr/coreName $NUTCH_HOME/urls/ $NUTCH_HOME/crawl 3**
它只抓取和索引一个 seed.txt url 并且在第二次迭代中它只是说:
Generator: starting at 2017-02-28 09:51:36
Generator: Selecting best-scoring urls due for fetch.
Generator: filtering: false
Generator: normalizing: true
Generator: topN: 50000
Generator: 0 records selected for fetching, exiting ...
Generate returned 1 (no new segments created)
Escaping loop: no more URLs to fetch now
当我更改 regex-urlfilter.txt 以允许一切 (+.) 它开始为 https://www.mywebsite.com 上的每个 URL 建立索引,这当然是我不想要的。
如果有人碰巧遇到同样的问题,请分享你是如何克服它的。
您可以尝试调整 conf/nutch-default.xml 中可用的属性。也许控制您想要的外链数量或修改获取属性。如果您决定覆盖任何 属性,请将该信息复制到 conf/nutch-site.xml 并将新值放在那里。
在最后 2 次中尝试了多种方法后,得到了解决方案 days.Here 是解决方案:
由于我抓取的网站很重,nutch-default.xml中的属性将其截断为65536字节(默认)。不幸的是我想抓取的链接没有得到包含在所选部分中,因此 nutch 没有爬行 it.When 我通过将以下值放在 nutch-site.xml 中将其更改为无限制,它开始爬行我的页面:
<property>
<name>http.content.limit</name>
<value>-1</value>
<description>The length limit for downloaded content using the http://
protocol, in bytes. If this value is nonnegative (>=0), content longer
than it will be truncated; otherwise, no truncation at all. Do not
confuse this setting with the file.content.limit setting.
</description>
</property>