如何解析错误的HTML? [英] How to parse bad html?

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

问题描述

我正在撰写一个搜索引擎,用于所有我公司的分支机构网站解析html并将它们存储在数据库中。这些网站真的很旧,并且在100000个网站中不符合html标准,大约有25%的网站有不好的html,这使得它很难分析。我需要编写一个c#代码来修复不良的html,然后解析这些内容或者提出一个解决上述问题的解决方案。如果你正在想法,一个实际的提示或代码片段将有所帮助。 Html 敏捷包。这是解析错误的html代码非常好

I am writing a search engine that goes to all my company affiliates websites parse html and stores them in database. These websites are really old and are not html compliant out of 100000 websites around 25% have bad html that makes it difficult to parse. I need to write a c# code that might fix bad html and then parse the contents or come up with a solution that will address above said issue. If you are sitting on idea, an actual hint or code snippet would help.

解决方案

Just use Html Agility Pack. It is the very good to parse faulty html code

这篇关于如何解析错误的HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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