How can I parse an HTML file under iOS? Any tutorials or sample code available?
Asked
Active
Viewed 6,063 times
4
-
You need to parse it to manage the data contained in the html page or you just need to display the html page? – lomanf Feb 09 '11 at 06:51
-
@lomanf I need to parse data from that html file and display it in my own view like table view. – Abhijeet Barge Feb 09 '11 at 06:54
-
2Please go through this link http://stackoverflow.com/questions/405749/parsing-html-on-the-iphone – Mihir Mehta Feb 09 '11 at 07:10
-
2OK then try to have a look here http://stackoverflow.com/questions/405749/parsing-html-on-the-iphone there's a nice example using the "hpple" library – lomanf Feb 09 '11 at 07:10
2 Answers
2
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

Jeremy Massel
- 2,257
- 18
- 22
1
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);

pradeepa
- 4,104
- 5
- 31
- 41