How can I parse an HTML file under开发者_高级运维 iOS? Any tutorials or sample code available?
Check out NSXMLParser. It's Apple's class for parsing XML documents. Should be a good start, if you know something about the format of the document in advance
Use XPathQuery to parse HTML or XML conveniently
- Google XPathQuery for iphone
- download XPathQuery.h and XPathQuery.m
- include both files in the project.
- Use the following method to parse HTML.
NSArray *PerformHTMLXPathQuery(NSData *document, NSString *query);
精彩评论