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

Discussion in 'ASP .Net' started by buran, Feb 15, 2009.

  1. buran

    buran Guest

    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
    buran, Feb 15, 2009
    #1
    1. Advertising

  2. buran

    buran Guest

    Hi, isn't there anyone to help me or to point me to somewhere? :(


    "buran" <> wrote in message
    news:...
    > 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
    buran, Feb 16, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    2
    Views:
    436
    clintonG
    Dec 17, 2005
  2. =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?=

    Deploying ASP.NET AJAX-Enabled Web site to host without AJAX insta

    =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?=, Feb 20, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    582
    Patrick
    Feb 21, 2007
  3. mark4asp
    Replies:
    1
    Views:
    1,124
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Mar 24, 2007
  4. Lloyd Sheen
    Replies:
    1
    Views:
    319
    Lloyd Sheen
    Nov 15, 2007
  5. Colin Halliday

    Setting Focus in Web User Control that Uses AJAX Update Panel

    Colin Halliday, Apr 24, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    189
    Colin Halliday
    Apr 24, 2007
Loading...

Share This Page