Screen scraping - But can't simulate javascript
<p>I have no problem to download the content of a specific URL.</p>

<p>But I have a ASP.NET page I must screen scrape where the interesting data is behind a click on a button. How can I simulate a click on that button and get the data that the webserver will produce?</p>

<p>The buttons runs this javascript:</p>

<pre><code>javascript:__doPostBack('ctl00$ctl01$DefaultSiteContentPlaceHolder1$Col1$ucNavBar$rptButtons$ctl00$btnPage','')
</code></pre>

<p>Right now I am using this ASP.NET code to get the content of a specific URL:</p>

<pre><code>public string GetDataFromUrl(string strUrl) 
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(strUrl);
 request.Accept = "text/html, application/xhtml+xml, */*";  
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64;      Trident/5.0)";
 request.KeepAlive = true;
 using (StreamReader streamReader = new          StreamReader(request.GetResponse().GetResponseStream(), Encoding.UTF8, true))
 {
 return streamReader.ReadToEnd();
 }
}
</code></pre>

<p>-- EDIT</p>

<p>I have found a solution. Used the program Fiddler to be able to see exactly what happens when I clicked on the button. Then I tried to make a POST that looked so simular as the real call as possible.</p>
