ok ive got this code:
public static string ScreenScrape(string url)
{
System.Net.WebRequest request = System.Net.WebRequest.Create(url);
// set properties of the request
using (System.Net.WebResponse response = request.GetResponse())
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()))
{
return reader.ReadToEnd();
}
}
}
Now I want to filter the text to get the div class=”comment” ones
is there another option other than using regular expressions? or is that the only way?
thanks
You need to use the HTML Agility Pack.
For example:
Note that this won’t find
<div class="OtherClass comment">; if you’re looking for that, you can callIndexOf.