I'm not sure if this is possible but I am trying to get the rendered content from a WKWebView. I know I can get the source using:
webView.evaluateJavaScript("document.getElementsByTagName('html')[0].innerHTML") { innerHTML, error in }
but the source I am working with is just a bunch of <script></script> tags whose code outputs the content.
I looked at webView.documentView but that's only useful for making a screen capture, I need the actual text content.