使用C#解析html标签元素及其属性 [英] parsing html tag elements along with thier properties using c#

查看:260
本文介绍了使用C#解析html标签元素及其属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解析用户给定的HTML代码文档,将其作为输入文件.所有HTML标记元素都需要与它们的各个属性分开.
再次将此文件作为另一个文件.因此,输出应该是带有所有html标记的文本文件,其文本格式的属性对于比较很有帮助.
它需要用C#完成.不需要考虑asp,jsp等...只需解析静态HTML代码.
请给我有关上述情况的逻辑.如果可能,请Plz帮助提供示例代码段.

I need to parse the HTML Code document given by the user,which is taken as the input file. All the HTML tag elements need to be seperated along with thier individual properties.
This again is taken as another file. So the output should be text file with all the html tags with their properties in text form useful for comparision.
It needs to be done in C#.NO need of considering asp,jsp etc... only static HTML code needs to be parsed.
Kindly give me the logic regarding the above case. Plz help with sample code snippets if possible.

推荐答案

^ ]可能会为您提供帮助.
Parsing HTML Tags in C#[^] might help you.




参见此 [在Code项目本身上查看此内容 [
Hi,

See this[^], &

See this, on Code project itself[^]

Hope, both the links will help you solve your query better.

Anurag :)


这篇关于使用C#解析html标签元素及其属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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