如何从网页检索链接? [英] How to retrieve links from a web page ?
问题描述
你好
我一直在寻找有关该问题的帮助
假设有一个网站....www.xyz.com
网站首页上有40个链接.
现在,我希望使用C#和asp.net,我确实有一个String数组,假设LinkArray [n]和TabArray [n] {string array},并且我希望应该有一个程序,
可以如下列出数组中的所有链接.
链接:
Hello
I was looking for some help regarding the problem that
Suppose there is one website....www.xyz.com
and there are 40 links on the website''s home page.
Now i want that using C# and asp.net i do have an String array suppose LinkArray[n] and TabArray[n] {string array} and i want that there should be a program which
can list all the links in the array as follows.
links :
<a href="xyz.com/home.html">Home</a> <a href="xyz.com/Contact.html"> </a>
etc
现在我希望在两个数组中将其存储为
TabArray [2](在数组值中包含选项卡)
主页
联系
LinkArray [2](包含数组值中的链接)
xyz.com/home.html
xyz.com/contact.html
同样,我希望我可以列出任何网页中的所有链接详细信息.
请给我建议一些代码/指南教程
谢谢
etc
Now i want that in two arrays it should be stored as
TabArray[2] (contains tabs in the array values)
Home
Contact
LinkArray[2] (contains links in the array values)
xyz.com/home.html
xyz.com/contact.html
Likewise i want that i can get listed all the links details in of any web page.
Please suggest me some code/ guide tutorials
Thanks
推荐答案
看看这篇文章屏幕抓取C#for ASP.NET [ ^ ].
如果您要从特定网页上抓取所有HTML链接和HREF,以维护或验证您的网站.这称为屏幕抓取.而且您会发现大约大约122,000个结果(0.09秒)
使用屏幕抓取C#关键字生成google结果.因此,更好地让您使用Google并提高解决问题的能力.
参考. C#抓取HTML链接
有关更多信息,请随时发表评论.
IF you want to scrape all HTML links and HREFs from specific web pages, for maintenance or validation of your site. This is called screen scraping. And You will find approx About 122,000 results (0.09 seconds)
google results by using screen scraping C# keywords. So better you google and improve your problem solving power.
Ref. C# Scraping HTML Links
For further information please feel free to leave a comment.
^ ]
http://www.dotnetperls.com/scraping-html [
http://stackoverflow.com/questions/5971662/how-to-find-all-links-in-web-page-using-coded-ui-test[^]
http://www.dotnetperls.com/scraping-html[^]
这篇关于如何从网页检索链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!