【问题标题】:Apache Nutch: No URLs to fetch - check your seed list and URL filtersApache Nutch:没有要获取的 URL - 检查您的种子列表和 URL 过滤器
【发布时间】:2011-07-11 10:48:01
【问题描述】:

我正在使用 nutch 1.2。当我像这样运行抓取命令时:

bin/nutch crawl urls -dir crawl -depth 2 -topN 1000

Injector: starting at 2011-07-11 12:18:37
Injector: crawlDb: crawl/crawldb
Injector: urlDir: urls
Injector: Converting injected urls to crawl db entries.
Injector: Merging injected urls into crawl db.
Injector: finished at 2011-07-11 12:18:44, elapsed: 00:00:07
Generator: starting at 2011-07-11 12:18:45
Generator: Selecting best-scoring urls due for fetch.
Generator: filtering: true
Generator: normalizing: true
Generator: topN: 1000
Generator: jobtracker is 'local', generating exactly one partition.
Generator: 0 records selected for fetching, exiting ...
Stopping at depth=0 - no more URLs to fetch.
**No URLs to fetch - check your seed list and URL filters.**
crawl finished: crawl

问题在于它一直在抱怨:没有要获取的 URL - 检查您的种子列表和 URL 过滤器。

我有一个要在 nutch_root/urls/nutch 文件下抓取的 url 列表。我的 crawl-urlfilter.txt 也设置好了。

为什么它会抱怨我的网址列表和过滤器?它以前从未这样做过。

这是我的 crawl-urlfilter.txt

# skip file:, ftp:, & mailto: urls
-^(file|ftp|mailto):

# skip image and other suffixes we can't yet parse
-\.(gif|GIF|jpg|JPG|png|PNG|ico|ICO|css|sit|eps|wmf|zip|ppt|mpg|xls|gz|rpm|tgz|mov|MOV|exe|jpeg|JPEG|bmp|BMP)$

# skip URLs containing certain characters as probable queries, etc.


# skip URLs with slash-delimited segment that repeats 3+ times, to break loops
-.*(/[^/]+)/[^/]+\1/[^/]+\1/

# accept hosts in MY.DOMAIN.NAME
+^http://([a-z0-9]*\.)*152.111.1.87/
+^http://([a-z0-9]*\.)*152.111.1.88/

# skip everything else
-.

【问题讨论】:

  • 也许添加您的 crawl-urlfilter.txt 和您的 seed.url 文件......过滤器可能实际上正在过滤您的种子
  • 你能发布你的 crawl-urlfilter.txt 吗?

标签: apache nutch


【解决方案1】:

您的 URL 过滤规则看起来很奇怪,我认为它们与有效的 URL 不匹配,这样应该更好吗?

+^http://152\.111\.1\.87/
+^http://152\.111\.1\.88/

【讨论】:

  • 从点'.'开始匹配任何单个字符,它也应该匹配 '.'我得到了一个工作配置,其中 url 过滤器设置为 +^123.123.123.123
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-03
  • 1970-01-01
  • 2018-09-07
相关资源
最近更新 更多