IOS-parsing HTML with tfhpple-go

Source: Internet
Author: User

Parsing HTML using Tfhpple

Https://github.com/topfunky/hpple

Pre-preparatory work

Introducing a static library file

Add the header of the library file search paths (note that all must be checked)

Drag the source package downloaded from GitHub into the project

The preparation is over.

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.

Printing information:

2014-05-16 11:39:24.113 html[3753:60b] Summary: Use Mapkit frame map to display the most simple code to display the map:////rootviewcontroller.m//corelocation//// Copyright (c) 2014 y.x. All rights reserved.//#import "RootViewController.h" ...
2014-05-16 11:39:24.116 html[3753:60b] Summary: Custom Uitabbar display Style The idea is this: 1. Initialize the Uitabbarcontroller and load several other ViewController2 in. Gets the UITABBARITEM3 for each controller. Individually configure each viewcontroller corresponding to the Uitabbaritem (where the text can be set to offset) so simple ...
2014-05-16 11:39:24.118 html[3753:60b] Summary: Use Uiscreenedgepangesturerecognizer to write IOS7 sidebar a Uiscreenedgepangesturerecognizer looks for panning (dragging) gestures so start near an edge of the the scre ...
2014-05-16 11:39:24.119 html[3753:60b] Summary: Using Html tags in uiwebview to display rich text with UIWebView to render text and expect to achieve rich text effect cost very much Oh! Work himself here directly loaded custom font "New small ball Body", the source is not open, hope forgive me. The code is as follows: After rendering the effect as shown, the effect is not quite good. Let's try to render the end two words red. Source:-(void) view ...
2014-05-16 11:39:24.122 html[3753:60b] Summary: Creating a gravity-sensing viewhttp://www.raywenderlich.com/zh-hans/using Uidynamicanimator 52617/uikit-Mechanics Tutorial Detailed tutorial Please refer to the above link, here is only the simplest use.////rootviewcontroller.m//Dynamicvie ...
2014-05-16 11:39:24.123 html[3753:60b] Summary: NOTE: Nimbuskit is a member of the top 20 iOS part of the Open Source Library on GitHub. Http://nimbuskit.info/https://github.com/jverkoey/nimbushttp://latest.docs.nimbuskit.info/Nimbus is a toolkit f ...
2014-05-16 11:39:24.125 html[3753:60b] Summary: IOS development TIPS & Tricks-part ihttp://blog.trifork.com/2013/12/19/i Os-development-tips-tricks-part-i/as you might know, I am very fond of devel ...
2014-05-16 11:39:24.126 html[3753:60b] Abstract: Using Cifilter to generate qrcode QR code image Cifilter can not only be used to make filters, it can also be used to generate two-dimensional code. CIFilterEffect.h + cifiltereffect.m////cifiltereffect.h//cifilter////Created by youxianming ...
2014-05-16 11:39:24.128 html[3753:60b] Summary: Use the Coreimage tutorial Coreimage contains a lot of useful filters, professional processing of pictures of the library, in order to see a variety of rendering effects, please use such as film material. Now you can start the tutorial. : #define FIX_IMAGE (image) Fiximagewidth (image, 320.F)//fixed image width uiimage * Fix ...
2014-05-16 11:39:24.130 html[3753:60b] Summary: Turn from Cocoachina http://www.cocoachina.com/macdev/uiue/2014/0505/8315. HTML you should know the application UI dynamic design rules in this article, I focused on the issues and reasons that need to be addressed in the UI dynamic design, rather than teaching the UI dynamic effect techniques. With everyone's attention to this area (great range ...

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

The rest of the matter is well done!

So easy!


IOS-parsing HTML with tfhpple-go

Related Article

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.