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:
Expand|Select|Wrap|Line Numbers
- string pattern = @"<a href="".*"">.*</a>";
- MatchCollection mc = Regex.Matches(webBrowser1.Document.Body.InnerHtml, pattern);
- foreach(object obj in mc)
- {
- Console.WriteLine(obj.ToString());
- }
Expand|Select|Wrap|Line Numbers
- <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>
Expand|Select|Wrap|Line Numbers
- The Scripts
- My Site
- Yet another site
Expand|Select|Wrap|Line Numbers
- http://www.thescripts.com The Scripts
- http://www.mysite.com My Site
- http://www.anothersite.com Yet another site