I've done a decent bit of research on this but can't seem to find a definitive answer or implement it correctly. I'm currently building an iOS app that contains a UIWebView that loads a webpage. However, rather than displaying the whole webpage I'd like to just extract a certain element from it (in this case a form) and only display that in the WebView (forgetting all other elements like the header, footer etc.).

What is the correct way to go about doing this?

有帮助吗?

解决方案

Run the URLRequest and store it in NSString. Trim unwanted content of this string and then in your UIWebView just call

[webView loadHTMLString:htmlString baseURL:nil];

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top