2012-01-09 3 views
0

J'essaie de ramper à l'aide nutch 1.4, mais je suis face à une erreur dans l'analyse syntaxique, c'est le fichier journal avec succès:nutch Impossible d'analyser le contenu

2012-01-09 09:12:02,696 INFO parse.ParseSegment - ParseSegment: starting at   2012-01-09 09:12:02 
2012-01-09 09:12:02,697 INFO parse.ParseSegment - ParseSegment: segment: crawl/segments/20120109091153 
2012-01-09 09:12:03,416 WARN parse.ParseUtil - Unable to successfully parse content http://sujitpal.blogspot.com/ of type application/xhtml+xml 
2012-01-09 09:12:03,417 INFO parse.ParseSegment - Parsing: http:// sujitpal.blogspot.com/ 
2012-01-09 09:12:03,418 WARN parse.ParseSegment - Error parsing: http://sujitpal.blogspot.com/: failed(2,200): org.apache.nutch.parse.ParseException: Unable to successfully parse content 
2012-01-09 09:12:03,419 INFO crawl.SignatureFactory - Using Signature impl: org.apache.nutch.crawl.MD5Signature 

en cochant config/nutch-site.xml J'ai trouvé html | texte | xhtml | xml sont inclus dans le plugin.includes preperty

<property> 
<name>plugin.includes</name> 
<value>myplugins|protocol-httpclient|query-(basic|site|url)|summary- 
basic|urlfilter-  
regex|parse-(xml|xhtml|html|tika|text|js)|index-(basic|anchor)|scoring- 
opic|urlnormalizer-(pass|regex|basic)|query-(basic|site|url)|response-(json|xml) 
</value> 
<description>Regular expression naming plugin directory names to 
include. Any plugin not matching this expression is excluded. 
In any case you need at least include the nutch-extensionpoints plugin. By 
default Nutch includes crawling just HTML and plain text via HTTP, 
and basic indexing and search plugins. In order to use HTTPS please enable 
protocol-httpclient, but be aware of possible intermittent problems with the 
underlying commons-httpclient library. 
</description> 
</property> 

Pourquoi ne peut-il analyser xhtml/xml ou même text/xml?

Répondre

1

Quels plugins avez-vous configurés? Si vous utilisez tika, alors tika a un mapping de type mime comme xhtml/xml vers un analyseur. S'il n'y a aucune entrée dans le configfile, rien ne se passe.

Vous pouvez désactiver tika et utiliser uniquement le plugin parse-html.

J'ai testé votre site avec notre configuration de plugin par défaut.

protocol-http|urlfilter-regex|parse-(html)|index-(basic|anchor) 
|query- (basic|site|url)|response-(json|xml) 
|summary-basic|scoring-opic|urlnormalizer-  
(pass|regex|basic) 

Et votre page a été analysée.

Parsed (32ms):http://sujitpal.blogspot.com/ 

grettings JPEE