views:

33

answers:

1

I am scraping a website that has a Javascript next link that looks like this <a href="javascript:__doPostBack('DataGrid1$ctl14$ctl02','')">2</a> .The page is written in aspx.

Is it possible to call that, to get the information on the next page?

Here is the page, http://www.deantechnology.com/hvca/pg_search/fsn.aspx?catalog_sspid=212&amp;catalog_spid=47&amp;catalog_msid=1

A: 

You want to post the form on the page setting the hidden fields to what is in the __doPostBack

So if your scraper can post, then copy the stuff looking like 'DataGrid1$ctl14$ctl01'

into the hidden field.

The code is here:

function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
mplungjan