1
I want to navigate to the Site and get the Current Bitcoin Value to Insert into a Label. This was my attempt that clearly didn’t work...
private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("https://www.mercadobitcoin.com.br/");
HtmlDocument doc = webBrowser1.Document;
label2.Text = doc.GetElementById("ticker_ultimo_grande-int").OuterText;
}
Site Area
<div class="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
at the event
Load
the page will not have finished being loaded, very likely you will be able to pick up the value using the eventprivate void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
– andrepaulo
doc has value?
– sir_ask
Thanks! It worked out.
– Sérgio Wilker