Alon M
Alon M

Reputation: 1683

Reading Html Code and finding <div> text. C#

i am useing this code to read html pages :

 WebClient client = new WebClient();
            String htmlCode = client.DownloadString(@"C:\checkemails\check.html");
            // Replace all html breaks for line seperators.
            htmlCode = htmlCode.Replace("<br>", "\r\n");
            MessageBox.Show(htmlCode);

the html page is on C:\ but lets say i am loading yahoo.com.. or what ever page.

i need to find a div named who got the id of

<div id ="say">

how can i do so?

Upvotes: 0

Views: 2421

Answers (1)

Yahia
Yahia

Reputation: 70369

try using HTMLAgilityPack for this sort of thing...

for select item from a div see for example Select only items in a specific DIV using HtmlAgilityPack

Upvotes: 3

Related Questions