in reply to Re: web::scraper using an xpath
in thread web::scraper using an xpath

Changing it to '//*/table[@class="someclass"]//tr' should work as intended

Replies are listed 'Best First'.
Re^3: web::scraper using an xpath
by jethro (Monsignor) on Dec 10, 2010 at 10:53 UTC
    Are you sure? In that case I would guess that he must also remove the 'tr' from his further process statements.
      Are you sure? In that case I would guess that he must also remove the 'tr' from his further process statements.

      Yup, I'm sure, and oddly no, there is no need to remove tr.

      It would have been easier to see if ag4ve had posted runnable code , but I adapted eg/dave-trailer-HD.pl

      I have no idea if this is intended behavior of this module

      nope, nothing else needed to be change. that worked perfectly. damned if i know why, but it had the result i was asking for :)

      i'm going to have to read more into xpath... what would be cool is i could figure out how to put a variable in the scraper function so that i could return even or odd in tr's instead of building up my xpath... for the moment though, i'm content. thanks whoever posted that.

        Odds
        process '//*/table[@class="someclass"]//tr[position() mod 2 = 1]',
        Evens
        process '//*/table[@class="someclass"]//tr[position() mod 2 = 0]',