开发者

how to get the title of a NSURl link without UIWebView

Is it possible to g开发者_StackOverflow社区et the title of a NSURL link without UIWebView ? Thanks.


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.


You can use stringWithContentsOfURL:encoding:error: to get the content of the link and then parse it using NSXMLParser to get the title.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜