Groups | Blog | Home
all groups > c# > july 2006 >

c# : I Want to Extract all URL's from HTML



CrimeMaster
7/31/2006 11:12:40 PM
Hi
i have stored the html of a web page into a string.And i want to
extract all the URL's and want to store them into an array of string.
plz help me if some body had write this Function pls send me the code i
will be thank full to u.

CreimeMaster.
Larry Lard
8/1/2006 12:00:00 AM
[quoted text, click to view]

Personally I'd use HtmlAgilityPack to parse the html into a DOM then
query that for <a> elements. But no doubt someone is even now preparing
a five line regex that will work nearly all the time...

--
Larry Lard
larrylard@googlemail.com
The address is real, but unread - please reply to the group
shrinerain
8/1/2006 4:00:01 AM
here is RegularExpression for u
new Regex("(?<=href *= *'?\"?)[^'\";>
]*",RegexOptions.IgnoreCase|RegexOptions.Compiled);


[quoted text, click to view]
AddThis Social Bookmark Button