'How to display int from web page (webscraping) in TextBox
I need somebody who tell me how to use Html Agility Pack in Windows Forms.
I have
`private void btnOnet_Click(object sender, EventArgs e)
{
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
HtmlWeb web = new HtmlWeb();
doc = web.Load("https://pogoda.onet.pl/");
var temperatura = doc.DocumentNode.SelectSingleNode("//div[contains(@class, 'temperature')]/div[contains(@class, 'temp')]");
onet.Text = temperatura.InnerHtml;
} `
I don't know how to display result in textBox aftek click Button. Should I create another method or do all in private void btnOnet_Click
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|