'How do I get url that is hidden by javascript on external website?

How do I get url that is hidden by javascript on external website?

ex: http://royaldesign.se/Att_Dricka.aspx This url is constant through navigation of pages, so page content is loaded by javascript.

link location of a page:

javascript:__doPostBack('ctl00$masterContent$DataPager2$ctl00$ctl00','')
javascript:__doPostBack('ctl00$masterContent$DataPager1$ctl00$ctl01','')
javascript:__doPostBack('ctl00$masterContent$DataPager1$ctl00$ctl02','')

.....

Is there a way to analyze (manually or by PHP script) the function __doPostBack to find out about the urls?

Thx in advance



Solution 1:[1]

Those values are not hidden, the __doPostBack method posts back to itself. Those values passed to doPostBack represent the html ID's of the control doing the postback.

The page your looking at is written in ASP.NET also, not PHP.

You can use your browsers debug tools to see what data is being passed back to the server via javascript.

Solution 2:[2]

The __doPostBack javascript function is used to submit data to an asp.net page.

The first parameter to the function is the event target. This is the ClientID of the control that is being clicked.

Asp.net uses this value to raise a Click event on the server when the page gets submitted.

You can call this __doPostBack function via javascript yourself to get the same behavior as a user clicking it.

Solution 3:[3]

I gave some tips on "scraping" ASP.net pages on this other question: curl script just filling up the form not submitting it

The basics of simulating a POST request using CURL are discussed here: PHP + curl, HTTP POST sample code?

I would also add that if the site you are "scraping" from is owned by someone you are on friendly terms with (and not e.g. a competitor!) you may be able to save a lot of time by asking nicely for the content, or a static URL that gives you the content.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 databyss
Solution 2 nunespascal
Solution 3 Community