Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I want to parse HTML page, but I am not sure which one is better, because some of them are wrapper of XML parser, so performance might be bad. I hope experience developer give me suggestion.

Hpple
ElementParser
Objective-C HTML Parser
XPathQuery
I have to answer by myself.

Objective-C HTML Parser is very simple, only four files, but has bug.
Hpple also looks like with bug.
XPathQuery is the simplest in two files, but seems like only support XML.

ElementParser is big with a lot files, but it has a demo and now I am using it.
 
HTML parser for Objc

Are you able to parse table ?I want to parse complex HTML page, It contains table.What would be the best way to do this?Right now I am using TFHpple. But I am facing difficulties while parsing complex table data with different fonts.Is there any library in Objective C which give the same result like JSOUP in java.
 
What is your goal for parsing html pages ?
To download all content to the device for offline use ? Or strip out certain parts from html or ... ?
 
my favourite

I want to parse HTML page, but I am not sure which one is better, because some of them are wrapper of XML parser, so performance might be bad. I hope experience developer give me suggestion.

Hpple
ElementParser
Objective-C HTML Parser
XPathQuery

The best one that I've used so far is HtmlCleaner :rolleyes:
HtmlCleaner is open-source HTML parser written in Java. HTML found on Web is usually dirty, ill-formed and unsuitable for further processing. For any serious consumption of such documents, it is necessary to first clean up the mess and bring the order to tags, attributes and ordinary text.
 
What is your goal for parsing html pages ?
To download all content to the device for offline use ? Or strip out certain parts from html or ... ?


I am getting html response from web page and have to display some of its data to tableview.
 
I am getting html response from web page and have to display some of its data to tableview.

Do you have control over the server that is producing the web page? If so, perhaps you should consider having it respond with XML or JSON which are more easily consumed and have better parsing tools available, including built-in ones.
 
Do you have control over the server that is producing the web page? If so, perhaps you should consider having it respond with XML or JSON which are more easily consumed and have better parsing tools available, including built-in ones.


I am getting html response from web page and have to display some of its data to tableview.

As dejo already questioned, are you the 'admin' of the webpage? Then you can generate some simpler page or something.

If not, you might be doing an parse with javascript, and inject it to the page to get result.
But then indeed you need some more knowledge of javascript and how the tables are build with idnames or column numbers.

Code:
NSString *myJavascriptResult = [myWebview stringByEvaluatingJavaScriptFromString: @"return \"Some returning value\";"];
NSLog(myJavascriptResult);
 
If you're the server admin then, as has already been suggested, just create a new Webpage that displays the info you want. Then you can display that information in your app using a UIWebView.
 
If you're the server admin then, as has already been suggested, just create a new Webpage that displays the info you want. Then you can display that information in your app using a UIWebView.

I would disagree with that. WebViews in apps are normally less than ideal. Instead OP should just set up the server to return some easily digestible data like JSON or XML and display that
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.