如何在C#中解析Html页面 [英] How Do I Parse Html Page In C#

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

问题描述

你好每个人

我想解析imdb网站中的html页面(例如使用html agility pack)并提取内容......我怎么能这样做? plz帮助我

hello every body
I want to parse html pages in imdb site (e.g by using html agility pack) and extract the content... how can i do it? plz help me

推荐答案

如果这是一个格式良好的XML文档,那么你可以使用.NET XML解析器解析它。不幸的是,并非所有网页都是这样的,因此您可能需要HTML解析器,它不需要格式良好的XML兼容性。试试这个: http://www.majestic12.co.uk/projects/html_parser.php [ ^ ]。



-SA
t would be good if this is a document well-formed as XML, then you could parse it using one of .NET XML parsers. Not all Web pages are like that, unfortunately, so you may need HTML parser which does not require well-formed XML compliance. Try this one: http://www.majestic12.co.uk/projects/html_parser.php[^].

—SA


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

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