开发者

Get a list of all the urls in a web page

开发者 https://www.devze.com 2023-01-15 07:37 出处:网络
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 te

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

精彩评论

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