Hello
Is it possible to retrieve then inner-text from a link with regular expressions?
For example, I can retrieve all links with regular expressions. With:
So i get the following matches:
But is it also possible to retrieve only the innertexts? So I would get the following results:
Or even better, more innertexts in one item like:
Thanks
Is it possible to retrieve then inner-text from a link with regular expressions?
For example, I can retrieve all links with regular expressions. With:
Code:
string pattern = @"<a href="".*"">.*</a>";
MatchCollection mc = Regex.Matches(webBrowser1.Document.Body.InnerHtml, pattern);
foreach(object obj in mc)
{
Console.WriteLine(obj.ToString());
}
Code:
<a href="http://www.thescripts.com">The Scripts</a> <a href="http://www.mysite.com">My Site</a> <a href="http://www.anothersite.com">Yet another site</a>
Code:
The Scripts My Site Yet another site
Code:
http://www.thescripts.com The Scripts http://www.mysite.com My Site http://www.anothersite.com Yet another site
Comment