解析iPhone上的HTML [英] parsing HTML on the iPhone

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

问题描述

任何人都可以推荐用于HTML解析的C或Objective-C库吗?它需要处理混乱的HTML代码,不会完全验证。



是否存在这样的库,或者我只是想使用正则表达式更好?

解决方案

看起来像 libxml2.2 出现在SDK中, libxml / HTMLparser.h 声明以下内容:
$ b


该模块实现了HTML 4.0非验证解析器API与XML解析器兼容。它应该能够解析真实世界的HTML,即使从规范的角度来看严重破坏。


听起来像是什么我需要,所以我可能会使用它。


Can anyone recommend a C or Objective-C library for HTML parsing? It needs to handle messy HTML code that won't quite validate.

Does such a library exist, or am I better off just trying to use regular expressions?

解决方案

Looks like libxml2.2 comes in the SDK, and libxml/HTMLparser.h claims the following:

This module implements an HTML 4.0 non-verifying parser with API compatible with the XML parser ones. It should be able to parse "real world" HTML, even if severely broken from a specification point of view.

That sounds like what I need, so I'm probably going to use that.

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

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