开发者

Get a list of all the urls in a web page

What's the best way to get an array of all the URLs in a web pa开发者_C百科ge? and how would I do it?


Using HTML Agility Pack is a good way, maybe not the best as this would be subjective but I can tell you the worst and this is using regular expression to parse html (as you've tagged your question with regex I feel myself ion the obligation to point this out).


/<a href=\"([^\"]*)\">(.*)<\/a>/iU

or use this previous answer:

Regular expression for parsing links from a webpage?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜