You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by cu...@apache.org on 2005/04/06 23:47:07 UTC
svn commit: r160335 -
incubator/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java
Author: cutting
Date: Wed Apr 6 14:47:06 2005
New Revision: 160335
URL: http://svn.apache.org/viewcvs?view=rev&rev=160335
Log:
Fail faster when looking for TITLE and BASE tags. These are only in
HEAD, so we can stop once we see the BODY.
Modified:
incubator/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java
Modified: incubator/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java
URL: http://svn.apache.org/viewcvs/incubator/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java?view=diff&r1=160334&r2=160335
==============================================================================
--- incubator/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java (original)
+++ incubator/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java Wed Apr 6 14:47:06 2005
@@ -146,6 +146,9 @@
* @return true if a title node was found, false otherwise
*/
public static final boolean getTitle(StringBuffer sb, Node node) {
+ if ("body".equalsIgnoreCase(node.getNodeName())) // stop after HEAD
+ return false;
+
if (node.getNodeType() == Node.ELEMENT_NODE) {
if ("title".equalsIgnoreCase(node.getNodeName())) {
getText(sb, node);
@@ -169,6 +172,11 @@
// is this node a BASE tag?
if (node.getNodeType() == Node.ELEMENT_NODE) {
+
+ if ("body".equalsIgnoreCase(node.getNodeName())) // stop after HEAD
+ return null;
+
+
if ("base".equalsIgnoreCase(node.getNodeName())) {
NamedNodeMap attrs = node.getAttributes();
for (int i= 0; i < attrs.getLength(); i++ ) {
when compile nutch-0.6,there is a problem
Posted by Zhou LiBing <zh...@gmail.com>.
when compile nutch-0.6,there is a problem.
First I execute the command "ant jar"
Then, " ant war " ,then the compiling is failed ,the error report as follows
================================================
[xslt] Loading stylesheet /home/bluegrid/nutch/src/web/style/nutch-
header.xsl
[xslt] : Fatal Error! java.net.ConnectException: Connection timed out Cause:
java.net.ConnectException: Connection timed out
[xslt] Failed to process /home/bluegrid/nutch/src/web/include/de/header.xml
BUILD FAILED
/home/bluegrid/nutch/build.xml:272: Following error occured while executing
this line
/home/bluegrid/nutch/build.xml:238: Fatal error during transformation
================================================
I do not know ,How is going on about this ,could you help me?
thank you