iOS parsing HTML using tfhpple

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.