prip
prip

Reputation: 91

How can a Perl web crawler follow an ASP.NET postback?

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>

Upvotes: 5

Views: 1958

Answers (3)

user1126070
user1126070

Reputation: 5069

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

Upvotes: 0

ysth
ysth

Reputation: 98398

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.

Upvotes: 1

Related Questions