Thursday, February 18, 2016

Page source fetch from WebView or UIWebView

On both Android and iOS, it is possible for an application to obtain page source from a browser view.

For Android,
http://lexandera.com/2009/01/extracting-html-from-a-webview/


For iOS,
http://stackoverflow.com/questions/5167254/getting-the-html-source-code-of-a-loaded-uiwebview

    NSString *yourHTMLSourceCodeString = [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.outerHTML"];       

Question:  How to with WKWebView?

No comments:

Post a Comment