Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: web::scraper using an xpath

by jethro (Monsignor)
on Dec 10, 2010 at 10:53 UTC ( [id://876432]=note: print w/replies, xml ) Need Help??


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

Are you sure? In that case I would guess that he must also remove the 'tr' from his further process statements.

Replies are listed 'Best First'.
Re^4: web::scraper using an xpath
by Anonymous Monk on Dec 10, 2010 at 11:17 UTC
    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

Re^4: web::scraper using an xpath
by ag4ve (Monk) on Dec 10, 2010 at 16:09 UTC

    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]',

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://876432]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 16:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found