0

I would like to get the latest content of a page that updates too often, for example, https://www.oanda.com/currency/live-exchange-rates/ (prices update every five second on weekdays)

I am using the following code:

        var webBrowser = new WebBrowser();
        webBrowser.ScriptErrorsSuppressed = true;
        webBrowser.AllowNavigation = true;
        webBrowser.Navigate("https://www.oanda.com/currency/live-exchange-rates/");

        while (webBrowser.ReadyState != WebBrowserReadyState.Complete) {
            Application.DoEvents();
        }
        string myData = webBrowser.DocumentText;

But that does not return me the latest info as shown in the page. Eventually I would like to re-parse that page and get the latest data a few minutes/seconds later.

Any ideas?

Miguel Mateo
  • 189
  • 1
  • 15
  • 1
    It's probably caching the result. Try webBrowser.Refresh(WebBrowserRefreshOption.Completely). https://msdn.microsoft.com/en-us/library/ts4tye44(v=vs.110).aspx – JBC Jul 11 '16 at 15:51
  • I do not think that is the issue, all I need is to load after the JScript runs, but I have no clue how to get it done. Any other idea? – Miguel Mateo Jul 16 '16 at 13:24
  • This seems relevant: http://stackoverflow.com/questions/2777878/detect-webbrowser-complete-page-loading – JBC Jul 17 '16 at 00:21

0 Answers0