Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

agreatdaytocode
24,757 PointsParsing text from a website
I'm trying to parse text from a website into a label is this possible? if so what's the best way to go about it?
3 Answers
Jack Solomon
839 PointsPersonally, I disagree. Have a look at a Ray Wenderlich (an iOS dev blog/tutorials) on how to parse HTML: http://www.raywenderlich.com/14172/how-to-parse-html-on-ios
If an API is available for the site you are querying data from, that would be ideal, but not many sites do, and parsing HTML isn't too hard. I was able to follow along with the tutorial (I have almost no HTML knowledge) with no difficulty.

James Barnett
39,199 PointsIn general that's a terrible idea, it's usually referred to as screen scraping as the only way to get that information is to download HTML and parse it.

agreatdaytocode
24,757 PointsWhat would be ideal?

James Barnett
39,199 PointsUsing an API

agreatdaytocode
24,757 PointsI'm trying to parse the "Currently Tracking:" stats from www.threatconnect.com I'm not sure that an API would help.

James Barnett
39,199 PointsWhat would be ideal is if threatconnet.com exposed that data to you via an API call.
James Barnett
39,199 PointsJames Barnett
39,199 PointsActually I totally agree with what that blog article is saying ...