Purpose C - UIWebview to load only a specific part of a webpage?

I'm working with a UIWebview, anyway, can I just load just the body of the web page and not the whole web page using my UIWebView (aka not load the header and footer)? This site is not mine. But looking at the HTML of this site, I only want to load the div id = "mainContent" in / div Either by writing some objective c or javascript?

Thank! Alan

+3


source to share


1 answer


With the Web-Kit, you can parse the incoming HTML and do whatever you like (within the legal rights of the site you are viewing)

Once the data is loaded, you can easily edit the HTML in the WKView.



If you have an output to a webView you can do: (for example UIWebView on iOS)

[webView loadHTMLString:htmlString baseURL:nil];
[webView setNeedsDisplay];

      

+3


source







All Articles