passingby has asked for the wisdom of the Perl Monks concerning the following question:
and it works beautifully. However, when I try to apply that same code to another page, it brings nothing, but in this case the urls are not that simply hardcoded but embedded in JS code(yes I know that Mechanize does not work on JS, but not fully exactly know what they mean by "it does not work on JS, it can mean that it won't be able to follow a link that is embedded in a onClick event, OR will it also mean that it won't obey me if I try to use that regex to obtain the URL that is inside this JS code:$booty->get("http://www.hotairballooning.com/clubs.php"); @url_array = $bot->find_all_links( text_regex => qr/www/ ); foreach(@url_array){ print $counter += 1, ":"; print $_->url(), "\n"; } # end of foreach
It just won't pick it up. Does it mean that the find_all_links method won't work there ? Am I then left with the only option of grabbing the $booty->content() maybe turn it into plain text and then just do the regex on them ? Thank you very much P.Yonclick="javascript:window.location='http://www.aaaa.org/bbb/cccc.php2 +?id=9244'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mechanize find links query
by Corion (Patriarch) on Dec 16, 2011 at 14:56 UTC | |
|
Re: Mechanize find links query
by TJPride (Pilgrim) on Dec 16, 2011 at 15:58 UTC | |
by Anonymous Monk on Dec 28, 2011 at 12:05 UTC |