komdrat54 has asked for the wisdom of the Perl Monks concerning the following question:

Hello all mates, I am a new user to this site and a beginner with PERL. I am trying to get whole article base from page

 http://knowledgebase.progress.com/pkb_Home?l=en_US&c=Product_Group%3AArcade%2CArea_of_Interest%3AAdmin_Config&pg=kbase

to save on local disk.

In my PERL script am able to get links to articles that apears on page but i don't know how to simulate click on "Next" link to get the rest of articles. Is it possible in Perl ? When click on this link, server run AJAX script to fetch next links to articles.

I google that problem but I only find that I should write my own version of AJAX script :/. Is a diffrent way to do this ?

I use  LWP::UserAgent->new; to get page content and i also had second version where I use  WWW::mechanize->new; method to get page content.

I try method  $mech->form_name('j_id0:j_id1:j_id186:j_id187:j_id191')->action($action); but still without positive result

I see that also is possible to run  $ie->get('javascript:functionToExecute()'); when use Win32::IE:: Mechanize but I don't know how to run AJAX script from this page.

Onclick action:

 onclick="A4J.AJAX.Submit('j_id0:j_id1:j_id186:j_id187:j_id191',event,{'status':'j_id0:j_id1:j_id186:j_id187:j_id191:nextStatus','similarityGroupingId':'j_id0:j_id1:j_id186:j_id187:j_id191:j_id238','parameters':{'j_id0:j_id1:j_id186:j_id187:j_id191:j_id238':'j_id0:j_id1:j_id186:j_id187:j_id191:j_id238'} } );return false;"

Replies are listed 'Best First'.
Re: Run onclick action on website.
by ww (Archbishop) on Aug 13, 2014 at 15:44 UTC
Re: Run onclick action on website.
by Anonymous Monk on Aug 13, 2014 at 12:58 UTC
    If the button runs an AJAX script to form the page then you must find a way to send what it does and to then do what it does with what it receives. Maybe a better solution to your problem is to use Selenium, a non-Perl tool which actually drives an actual browser. Instead of trying to simulate what a browser does ... drive a browser directly.
Re: Run onclick action on website.
by Anonymous Monk on Aug 13, 2014 at 21:50 UTC