Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: How to extract xpath from the webpage

by perladdict (Chaplain)
on Nov 04, 2009 at 05:50 UTC ( #804855=note: print w/replies, xml ) Need Help??

in reply to Re: How to extract xpath from the webpage
in thread How to extract xpath from the webpage

Hi Corion, I am doing web page automation to find the links, text and image links by using selenium,which uses xpath to locate the links like "//td2/div/a/img" from the web page source. I am trying.
I am trying with Html::TreeBuilder::xpath, i don't know what are all the other modules i can import in my script.
  • Comment on Re^2: How to extract xpath from the webpage

Replies are listed 'Best First'.
Re^3: How to extract xpath from the webpage
by Corion (Pope) on Nov 04, 2009 at 08:10 UTC

    If Selenium supports XPath queries, you don't need any Perl XPath modules. If you want to access Selenium and its results, see WWW::Selenium. If you want to use HTML::TreeBuilder::XPath, I'm not sure where your actual problem in your code is. The "synopsis" section shows how to extract HTML fragments from a given HTML string. Maybe you want to fetch the images using LWP::UserAgent then?

    Personally, I automate websites with WWW::Mechanize::FireFox, which supports Javascript (and XPath).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://804855]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-10-23 10:10 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (279 votes). Check out past polls.