Ahsan
Ahsan

Reputation: 2982

how to get the title of a NSURl link without UIWebView

Is it possible to get the title of a NSURL link without UIWebView ? Thanks.

Upvotes: 1

Views: 1022

Answers (2)

Deepak Danduprolu
Deepak Danduprolu

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

RyanR
RyanR

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

Related Questions