Hi,

On 14 May 2015 at 16:30, Mark Wilson <[email protected]> wrote:

> Hi everyone.
>
> I wonder if anyone can help me.
>
> I am crawling our site with nutch 1.9, and would like to be able to parse
> the pages but not the headers, navbar and footer.
>

You can apply the patch from https://issues.apache.org/jira/browse/NUTCH-585
which adds a feature to nutch-site.xml:

  <property>
    <name>parser.html.NodesToExclude</name>

<value>div;class;top-menu|div;class;tx-headerbannermain-pi1|div;id;searchHereOn|div;id;footer|ul;class;breadcrumbs;div;class;share_links</value>
    <description>
      A list of nodes whose content will not be indexed separated by "|".
      Use this to tell the HTML parser to ignore, for example, site
navigation text.

      Each node has three elements, separated by semi-colon:
      the first one is the tag name,
      the second one the attribute name,
      the third one the value of the attribute.

      Example: table;summary;header|div;id;navigation

      Note that nodes with these attributes, and their children, will be
      silently ignored by the parser so verify the indexed content
      with Luke to confirm results.
    </description>
  </property>


I've been using this in a lot of projects already. Only issue is that it
doesn't allow you to exclude tags without specific attributes and attribute
values. But in all my cases this wasn't a problem.

-- 


Met vriendelijke groet,


Jigal van Hemert | Ontwikkelaar



Langesteijn 124
3342LG Hendrik-Ido-Ambacht

T. +31 (0)78 635 1200
F. +31 (0)848 34 9697
KvK. 23 09 28 65

[email protected]
www.alternet.nl


Disclaimer:
Dit bericht (inclusief eventuele bijlagen) kan vertrouwelijke informatie
bevatten. Als u niet de beoogde ontvanger bent van dit bericht, neem dan
direct per e-mail of telefoon contact op met de verzender en verwijder dit
bericht van uw systeem. Het is niet toegestaan de inhoud van dit bericht op
welke wijze dan ook te delen met derden of anderszins openbaar te maken
zonder schriftelijke toestemming van alterNET Internet BV. U wordt
geadviseerd altijd bijlagen te scannen op virussen. AlterNET kan op geen
enkele wijze verantwoordelijk worden gesteld voor geleden schade als gevolg
van virussen.

Alle eventueel genoemde prijzen S.E. & O., excl. 21% BTW, excl. reiskosten.
Op al onze prijsopgaven, offertes, overeenkomsten, en diensten zijn, met
uitzondering van alle andere voorwaarden, de Algemene Voorwaarden van
alterNET Internet B.V. van toepassing. Op al onze domeinregistraties en
hostingactiviteiten zijn tevens onze aanvullende hostingvoorwaarden van
toepassing. Dit bericht is uitsluitend bedoeld voor de geadresseerde. Aan
dit bericht kunnen geen rechten worden ontleend.

! Bedenk voordat je deze email uitprint, of dit werkelijk nodig is !

Reply via email to