using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using HtmlAgilityPack; using System.Net; namespace Project_1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; } private void button1_Click(object sender, EventArgs e) { string path="/html/body/div[1]/div/div[3]/div/div[2]/div[1]/div[1]/div[2]"; HtmlWeb myweb = new HtmlWeb(); HtmlAgilityPack.HtmlDocument doc = myweb.Load("https://www.practo.com/jamnagar/doctors"); var HeaderNames =( doc.DocumentNode.SelectNodes(path)); if (HeaderNames != null) { var mylist = HeaderNames.ToList(); foreach (var item in mylist) if (item != null) { listBox1.Items.Add(item); } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)