5

I'm building a webcrawler in Perl/LWP. How can the webcrawler follow a link in a ASP.NET grid like this:

<a id="ctl00_MainContent_listResult_Top_LnkNextPage" href="javascript:__doPostBack('ctl00$MainContent$listResult$Top$LnkNextPage','')">Next</a>
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
prip
  • 91
  • 1
  • 4
  • +1, because regardless of my reservations of it being unanswerable, if it is actually answerable, I want to know too – Kent Fredric Jun 14 '09 at 22:31

3 Answers3

1

Looks like there's a WWW::Mechanize subclass called WWW::Scripter with javascript and ajax plugins that should be able to do this. Haven't tried that particular approach.

The other alternative is WWW::Selenium, which works great but may be too much overhead/setup for you.

ysth
  • 96,171
  • 6
  • 121
  • 214
1

See CPAN module HTML::TreeBuilderX::ASP_NET.

Alexandr Ciornii
  • 7,346
  • 1
  • 25
  • 29
  • It almost makes sense that there's a CPAN module specifically to deal with this sickness :) – ysth Jun 15 '09 at 07:43
0

Use WWW-Mechanize-Firefox, it is able to retrieve/follow any links that Firefox could.

You need to install mozrepl addon to firefox and the perl module will be connect to that addon and use firefox to open the links.

http://metacpan.org/pod/WWW::Mechanize::Firefox

Examples: http://metacpan.org/pod/WWW::Mechanize::Firefox::Examples

szabgab
  • 6,202
  • 11
  • 50
  • 64
user1126070
  • 5,059
  • 1
  • 16
  • 15