搜索现有网站的元标记 [英] Searching meta tags of existing website

查看:76
本文介绍了搜索现有网站的元标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我想搜索已经存在的网站的元标记(因为我想访问该网站上显示给访客的一些信息).

怎么做


谢谢您

Hello

I want to search meta tag of already existing website (because i want to acess some information displayed to guest on that site).

How can it be done


Thank You

推荐答案

您需要使用System.Net.HttpWebRequest使用"GET"方法来获取所需的HTTP资源.为此的编译时类型必须为System.Net.WebRequest,因为运行时类是由传递给其工厂方法Create的URI定义的.
请在此处查看代码示例: http://msdn.microsoft.com/zh-cn/library/system.net.webrequest.aspx [ ^ ].

从响应流中,您将读取包含所有HTML文件内容的字符串.然后,您需要解析HTML以提取META标签.例如,检查Majestic-12开源HTML解析器: http://www.majestic12.co.uk/projects/html_parser.php [^ ].

—SA
You need to get desired HTTP resource using System.Net.HttpWebRequest using "GET" method. A compile-time type for this must be System.Net.WebRequest as the run-time class is defined by the URI passed to its factory method Create.

See the code sample here: http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[^].

From the response stream, you will read the string with all the HTML file content. Then you need to parse HTML to extract META tags. For example, check Majestic-12 Open Source HTML parser: http://www.majestic12.co.uk/projects/html_parser.php[^].

—SA


转到网站,右键单击查看源,在head标签中提供所有元信息.......:)
Go to the website, right click view source, in the head tag all meta information is given ....... :)


希望 [ ^ ]可能会为您提供帮助.
Hope this[^] might help you.


这篇关于搜索现有网站的元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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