I have a webpage. If I look at the "view-source" of the page, I find multiple instance of following statement:
<td class="my_class" itemprop="main_item">statement 1</td>
<td class="my_class" itemprop="main_item">statement 2</td>
<td class="my_class" itemprop="main_item">statement 3</td>
I want to extract data like this:
statement 1
statement 2
statement 3
To accomplish this, I have made a method "GetContent" which takes "URL" as parameter and copy all the content of the webpage source in a C# string.
private string GetContent(string url)
{
HttpWebResponse response = null;
StreamReader respStream = null;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Timeout = 100000;
response = (HttpWebResponse)request.GetResponse();
respStream = new StreamReader(response.GetResponseStream());
return respStream.ReadToEnd();
}
Now I want to create a method "GetMyList" which will extract the list I want. I am searching for the possible regex which can serve my purpose. Any help is highly appreciated.