I know how to get the html of a webview, but in my case, a lot of the html is just javascripts that load content. Is there a way to get what is displayed in the window? I logged webview.enclosedScrollView.documentView
and that returned nil.
Is there a way to capture the rendered content?
You can generate a PDF from the HTML - see the following website: https://coderwall.com/p/gssuka/rendering-html-pdf-report-for-printing-from-uiwebview
I am currently using that code with a WKWebview. Read the article first as you will need the PRV300dpiPrintRenderer class (you may have to update it to a newer Swift syntax). My code: