Parsing HTML in IOS development there are a lot of well-written parsing frameworks on the web today. How to parse HTML with frame Tfhpple
Parsing HTML using Tfhpple
GitHub address : https://github.com/topfunky/hpple
There are two ways of introducing
The first: A source package that is downloaded directly from GitHub and dragged into the project
The second type: Using pod tfhpple to introduce
But we have to do all the preparatory work.
Introducing a static library file
Add the header of the library file search paths (note that all must be checked)
Ready to use the following
Usage details
Let's parse the title tag in URL http://www.cnblogs.com/YouXianMing/.
The idea is this:
1. Convert Web page to NSData
2. Query the data in NSData according to the tag value
3. Retrieve the desired data
Print the following information:
2014-05-16 11:34:19.227 html[3736:60b] <title> Shangming-Blog Park </title>
2014-05-16 11:34:19.230 html[3736:60b] Shangming-Blog Park
Let's parse a complex point, such as parsing all the summary information in a Web page.
Again to test under CSDN's:
As long as you can divide it clearly:
Node
Node properties
Node Property value
The contents of the node
It's a good run.
iOS parsing HTML using tfhpple