Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
the goal for this url is to get "/watch?v=JP68g3SYObU" but im having trouble figuring out how to extract that data from the module and xpath.se LWP::UserAgent; use HTML::TreeBuilder::XPath; use HTML::Selector::XPath; my $ua = LWP::UserAgent->new; my $html = "http://www.youtube.com/results?search_query=run+flo+rida"; my $tree = HTML::TreeBuilder::XPath->new; my $xpath = HTML::Selector::XPath::selector_to_xpath("(//*[@id = 'sear +ch-results']/li)[1]/div[2]/h3/a/@href/"); my @nodes = $tree->findnodes($xpath);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get data from xpath
by tobyink (Canon) on Jan 21, 2013 at 09:19 UTC | |
|
Re: get data from xpath
by Kenosis (Priest) on Jan 21, 2013 at 07:43 UTC | |
|
Re: get data from xpath
by tmharish (Friar) on Jan 21, 2013 at 08:01 UTC | |
|
Re: get data from xpath
by Anonymous Monk on Jan 21, 2013 at 07:03 UTC | |
|
Re: get data from xpath
by harimetkari (Initiate) on Jan 21, 2013 at 06:46 UTC | |
by Anonymous Monk on Jan 21, 2013 at 07:01 UTC |