如何在C#中获取所有网站 [英] How to get all the websites in C#

查看:83
本文介绍了如何在C#中获取所有网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在编写一个程序,在该程序中,它可以在一个搜索页面中获取所有网站,并获取url或这些网站,然后它将在一个文本框中显示所有网站.不是网络浏览器.
我的意思是,例如当客户输入搜索内容时,我的程序将写入所有网站名称.使用谷歌.就像在Google中想象的那样,我输入"Hello".然后,我的工具在页面中找到所有网站,并在文本框中列出它们

我该怎么做

Hey all,
I am making a program in which it gets all the websites in one search page and gets the url or those websites then it will show all of the websites in a text box. Not a web browser.
I mean like when Client Enters a search My program will write all the websites names. Using Google. Like imagine in google i enter ''Hello''. Then my tool finds all websites in the page and lists them in a text box

How can i do that

推荐答案

这看起来像是 Web抓取: ^ ].

请查看我过去的答案,解释其中涉及的内容:
如何从另一个站点获取数据 [ ^ ],
从网页中获取特定数据 [
This looks like something called Web scraping: http://en.wikipedia.org/wiki/Web_scraping[^].

Please see my past answers explaining what''s involved:
How to get the data from another site[^],
get specific data from web page[^].

—SA


您可以使用Bing API或Google API来搜索关键字并列出您的网站(结果)

bing.
http://www.bing.com/developers/s/APIBasics.html [ ^ ]

对于Google
https://developers.google.com/custom-search/v1/overview [ ^ ]

您可以在Windows窗体,wpf,silverlight或asp.net的任何地方使用这些API.

如果您已经有一个页面列出了需要剪贴的内容,则使用Sergey的方法(在上方)
You can use either Bing API or Google API to perform the search for a keyword and list your websites (results)

for bing.
http://www.bing.com/developers/s/APIBasics.html[^]

for google
https://developers.google.com/custom-search/v1/overview[^]

You use these APIs from anywhere, windows forms, wpf, silverlight or asp.net.

if you already have a page listing the content that you need to scrap, then use Sergey''s approach (above)


这篇关于如何在C#中获取所有网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆