Reputation: 2982
Is it possible to get the title of a NSURL link without UIWebView ? Thanks.
Upvotes: 1
Views: 1022
Reputation: 44633
You can use stringWithContentsOfURL:encoding:error:
to get the content of the link and then parse it using NSXMLParser
to get the title.
Upvotes: 2
Reputation: 7758
You can load the content which the URL points to and parse the HTML for the title element, but that won't account for changes to the title as a result of javascript execution. So the answer is 'no', there isn't any way to reliably get the title of a page which is at a given URL.
Upvotes: 1