You have to do
NSString *html = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"www.apple.com"]];
However, if you decide to use UIWebView to retrieve the HTML, you can try
NSString *html = [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.outerHTML"];
or
NSString *html = [webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
adam
source share