namespace stockmarket_data { using HtmlAgilityPack; using System; using System.Linq; internal class Program { static void Main(string[] args) { string url = "https://www.google.com/search?q=nse+reliance&oq=nse+reliance&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCTc2NzRqMGoxNagCALACAA&sourceid=chrome&ie=UTF-8"; var web = new HtmlWeb(); var doc = web.Load(url); try { HtmlNode priceElements = doc.DocumentNode.SelectSingleNode("//span[@class='knowledge-finance-wholepage-chart__hover-card-value']"); if (priceElements != null) { Console.WriteLine(priceElements.InnerHtml.ToString()); } } catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)