Welcome! I am an indie iOS Developer, Web Developer, and all around code monkey! Please feel free to take a look around and if you have any questions you can contact me using this form

How to Parse HTML on iOS

Article posted on Wednesday, July, 4th, 2012 at 7:00 pm

Tutorial excerpt:

Let’s say you want to find some information inside a web page and display it in a custom way in your app.


This technique is called “scraping.” Let’s also assume you’ve thought through alternatives to scraping web pages from inside your app, and are pretty sure that’s what you want to do.


Well then you get to the question – how can you programmatically dig through the HTML and find the part you’re looking for, in the most robust way possible? Believe it or not, regular expressions won’t cut it!


Well, in this tutorial you’ll find out how! You’ll get hands-on experience with parsing HTML into an Objective-C data model that your apps can use.


In fact, you’ll work with some HTML from this very site, downloading a list of tutorials and also a list of the members of the iOS Tutorial Team (who are quite awesome, if I do say so myself).


Even if you are pretty sure you never want to parse HTML in your apps, you might enjoy this tutorial anyway, because it covers some cool things you can do with XML and querying its elements with XPath.


This tutorial assumes some familiarity with Objective-C and iOS programming. If you are a complete beginner, you may wish to check out some of the other tutorials on this site.


Let’s start scraping!


Read more at Raywenderlich.com

No comments

Leave a Reply

© 2012 Brandon Lassiter