- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是这个领域的新手。我从本教程开始:http://nlp.solutions.asia/?p=362#more-362 。当我第一次爬取这个网址:nutch.apache.org时,我成功了,但是当我尝试不同的网址时,我的hadoop.log中出现了这个异常。
**java.lang.NullPointerException
at org.apache.avro.util.Utf8.<init>(Utf8.java:37)
at org.apache.nutch.crawl.GeneratorReducer.setup(GeneratorReducer.java:100)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:174)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:398)**
<小时/>
这是我的 nutch-site.xml:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>http.agent.name</name>
<value>Maria</value>
</property>
<property>
<name>http.robots.agents</name>
<value>Maria</value> ....
</description>
</property>
<property>
<name>http.accept.language</name>
<value>ja-jp, en-us,en-gb,en;q=0.7,*;q=0.3</value>
<description>Value of the “Accept-Language” request header field.
This allows selecting non-English language as default one to retrieve.
It is a useful setting for search engines build for certain national group.
</description>
</property>
<property>
<name>parser.character.encoding.default</name>
<value>utf-8</value>
<description>The character encoding to fall back to when no other information
is available</description>
</property>
<property>
<name>storage.data.store.class</name>
<value>org.apache.gora.sql.store.SqlStore</value>
<description>The Gora DataStore class for storing and retrieving data.
Currently the following stores are available: ….
</description>
</property>
</configuration>
<小时/>
这是 regex-ulrfilter.txt:
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The default url filter.
# Better for whole-internet crawling.
# Each non-comment, non-blank line contains a regular expression
# prefixed by '+' or '-'. The first matching pattern in the file
# determines whether a URL is included or ignored. If no pattern
# matches, the URL is ignored.
# skip file: ftp: and mailto: urls
-^(file|ftp|mailto):
# skip image and other suffixes we can't yet parse
# for a more extensive coverage use the urlfilter-suffix plugin
-\.
(gif|GIF|jpg|JPG|png|PNG|ico|ICO|css|CSS|sit|SIT|eps|EPS|wmf|WMF|zip
|ZIP|ppt|PPT|mpg|MPG|xls|XLS|gz|GZ|rpm|RPM|tgz|TGZ|mov
|MOV|exe|EXE|jpeg|JPEG|bmp|BMP|js|JS)$
# 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 anything else
#+.
+^http://([a-z0-9]*\.)* nutch.apache.org/
#
-.
<小时/>
如果有任何解决此问题的建议,我将不胜感激
最佳答案
我从未使用过nutch,但这似乎是一个常见错误,在init 启动的NPE 意味着UTF8 实例在创建时失败。
原因是“crawl”函数在 Nutch2 中已被弃用,取而代之的是位于“bin/crawl”中的 java 文件
只需将文件 $NUTCH_HOME/src/bin/crawl 复制到部署目录:$NUTCH_HOME/runtime/deploy/bin 然后运行爬网命令,看看这里:
http://wiki.apache.org/nutch/NutchTutorial#A3.1_Using_the_Crawl_Command
希望这有帮助。
关于java.lang.NullPointerException(nutch 2.2.1 和 MySql 作为数据存储),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21198202/
如果 Nutch 页面已经在索引中,它们会再次索引它们吗?如果是这样,我该如何更改? 最佳答案 是和否。默认情况下,Nutch 只会在 1 个月的某个时间段(从内存中)重新索引页面,如果页面没有更改,
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我正在尝试开发一个应用程序,在该应用程序中,我将为 Nutch 中的 urls 文件提供一组受限的 url。我能够抓取这些 url 并通过从段中读取数据来获取它们的内容。 我通过提供深度 1 进行爬网
我正在为我的应用程序使用 nutch 爬虫,它需要爬取一组我提供给 urls 目录的 URL,并且只获取该 URL 的内容。我对内部或外部链接的内容不感兴趣。所以我使用了 NUTCH 爬虫,
我开始使用 Apache Nutch (v1.5.1) 来索引某个域下的所有网站。 我的域中有大量网站(以百万计),我需要逐步将它们编入索引,而不是等待整个过程结束。 我在 nutch wiki(这里
我正在使用 Nutch 抓取网站,我想解析 Nutch 抓取的 html 页面的特定部分。例如, title to search content to search
有没有什么办法可以在抓取网页的同时获取每个网页的html内容? 最佳答案 是的,您可以实际导出已抓取片段的内容。这并不简单,但对我来说效果很好。首先,使用以下代码创建一个java项目: import
我将 re_crawler 设置为每天获取一个站点。但它获取了这个站点 3 次。 我应该用 nutch 设置什么属性?谢谢。 最佳答案 我认为您在过去几个月中自己找到了解决方案,但这里是社区的答案。
一个相关Question on Stackoverflow存在,但六年半前有人问过。从那时起,Nutch 发生了很多变化。基本上我有两个问题。 我们如何比较 Nutch 和 Solr? 我们在什么情况
我的nutch在hadoop上运行,想查看nutch运行日志, 但找不到独立的 nutch 日志之类的输出日志。 最佳答案 如果你在hadoop上运行nutch,会生成每个phase的每个mapper
我试图使用 REST 端点公开 nutch,但在索引器阶段遇到了问题。我正在使用 elasticsearch 索引编写器将文档索引到 ES。我使用了 $NUTCH_HOME/runtime/deplo
我已经安装了完全分布式的 Hadoop 1.2.1。我试图通过以下步骤集成 nutch: 下载apache-nutch-1.9-src.zip 在nutch-site.xml中添加值http.agen
fetch of httpurl failed with: org.apache.nutch.protocol.ProtocolNotFound: protocol not found for url
我使用了从他们的 wiki 安装 nutch 的例子。我能够轻松抓取从 dmoz 中提取的多个页面。但是有没有一种配置可以抓取它在页面上找到的外部链接,或者将这些外部链接写入一个文件以供接下来抓取?
我正在使用与 mysql 集成的 Nutch 2.1。我已经抓取了 2 个站点,Nutch 成功抓取了它们并将数据存储到 Mysql 中。我正在使用 Solr 4.0.0 进行搜索。 现在我的问题是,
我想通过文本文件中的 nutch 获取抓取的内容。我已经使用了 #readseg 命令,但输出没有成果。 是否有一些插件可以让 nutch 抓取并将 url 和内容存储在文本文件中。 最佳答案 使用
我不能让 Nutch 小块地为我爬行。我从 开始bin/nutch 爬行 参数为 -depth 7 和 -topN 10000 的命令。它永远不会结束。仅在我的硬盘为空时结束。我需要做什么: 开始爬我
我在抓取我的网站时遇到问题...有一个带有两个下拉列表的表单....当我开始抓取时,抓取工具只从表单中获取部分链接....从第一个下拉列表中获取接受部分选项,从第二个下拉菜单开始......我尝试更改
我最近开始寻找 apache nutch。我可以进行设置并能够使用 nutch 抓取我感兴趣的网页。我不太了解如何读取这些数据。我基本上想将每个页面的数据与一些元数据(现在是一些随机数据)相关联,并将
我关注了文章:https://wiki.apache.org/nutch/NutchTutorial并设置 apache nutch +solr。但我想澄清一下我是否对 nutch 步骤的工作理解正确
我是一名优秀的程序员,十分优秀!