Get information from a website and put it on a label?

0

I want to navigate to the Site and Get Bitcoins Current Value to Insert into a Label. This was my attempt that clearly did not work ...

privatevoidForm1_Load(objectsender,EventArgse){webBrowser1.Navigate("https://www.mercadobitcoin.com.br/");

            HtmlDocument doc = webBrowser1.Document;
            label2.Text = doc.GetElementById("ticker_ultimo_grande-int").OuterText;

        }

Site Area

<divclass="mb-yellow-text text-center relative"><div id="hugePriceBrlSymbol">R$</div>
<div id="ticker_ultimo_grande-int">3924,</div>
<div id="ticker_decimal_group" class="clearfix">
<div id="ticker_ultimo_grande-dec">61</div></div>
<div class="clearfix"></div></div>

Error Message

    
asked by anonymous 21.04.2017 / 06:47

1 answer

0

What is happening is that you are not giving the site time to load the program.  I believe that if you put a Thread.Sleep(3) before, it works.

    
21.04.2017 / 18:31