Reading HTML content from a UIWebView

前端 未结 10 2468
感动是毒
感动是毒 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:26

    In Swift v3:

    let doc = webView.stringByEvaluatingJavaScript(from: "document.documentElement.outerHTML")
    

提交回复
热议问题