Reading HTML content from a UIWebView

前端 未结 10 2575
感动是毒
感动是毒 2020-11-22 13:47

Is it possible to read the raw HTML content of a web page that has been loaded into a UIWebView?

If not, is there another way to pull raw HTML content f

10条回答
  •  爱一瞬间的悲伤
    2020-11-22 14:35

    if you want to extract the contents of an already-loaded UIWebView, -stringByEvaluatingJavaScriptFromString. For example:

    NSString  *html = [webView stringByEvaluatingJavaScriptFromString: @"document.body.innerHTML"];
    

提交回复
热议问题