How to get a content of a page that updates too often using webbrowser in C#

痞子三分冷 提交于 2019-12-12 03:04:05

问题


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?

来源:https://stackoverflow.com/questions/38311132/how-to-get-a-content-of-a-page-that-updates-too-often-using-webbrowser-in-c-shar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!