how to get the values from a web site that uses AJAX functionality

  • Thread starter Thread starter buran
  • Start date Start date
B

buran

Dear ASP.NET Developers,

I would like to screen scape some values from a web site in a regular
interval. I had managed to do this by the code snippet given below, but the
web site now uses AJAX functionality to display the values.

string requestUrl =
"http://www.buranburanburan.com/buranburan/buran.aspx";
Uri address = new Uri(requestUrl);

HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(address);
HttpWebResponse response = (HttpWebResponse)
request.GetResponse();
StreamReader stream = new
StreamReader(response.GetResponseStream());
string source = stream.ReadToEnd();
source = source.Substring(source.IndexOf("USDTRL", 0), 40);
source = source.Substring(34, 6);

The web site now uses AJAX rather than directly outputting the values:

<script type="text/javascript">
/*function SendQuoteTableAjax()
{
var dt = new Date();
httpRequest.open( "GET",
"./somewebpage.aspx?callajax=true&dt="+dt.getTime(), true);
httpRequest.send(null);
setTimeout("SendTableQuoteAjax()",20000);
}
setTimeout("SendQuoteTableAjax()",20000);*/
</script>

How can I get the values now?

Thanks in advance,

buran
 
Back
Top