V
V
Vasily Vorobyov2016-03-13 16:29:44
Objective-C
Vasily Vorobyov, 2016-03-13 16:29:44

How to get and parse html c url in Objective C?

There is a url: airqualityegg.com/egg/1655739499
It is necessary to display three indicators in the application. What to write? This is my first time working with Objective C.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Sh, 2016-03-13
. @EgorkZe

This is how you can get the html code of the page:

NSString *myURLString = @"http://google.com";
NSURL *myURL = [NSURL URLWithString:myURLString];

NSError *error = nil;
NSString *myHTMLString = [NSString stringWithContentsOfURL:myURL encoding: NSUTF8StringEncoding error:&error];

if (error != nil)
{
    NSLog(@"Error : %@", error);
}
else
{
    NSLog(@"HTML : %@", myHTMLString);
}

and here is the library for parsing the page itself: Parser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question