Skip to content

Instantly share code, notes, and snippets.

@npu3pak
Last active May 25, 2017 18:10
Show Gist options
  • Save npu3pak/2742b026d4a6a7780f5fd024ebbe3269 to your computer and use it in GitHub Desktop.
Save npu3pak/2742b026d4a6a7780f5fd024ebbe3269 to your computer and use it in GitHub Desktop.
Извлекаем коненте из отображаемой страницы WKWebView
func htmlAsString()-> String? {
var result: String?
webView.evaluateJavaScript("document.documentElement.outerHTML.toString()") { (html: Any?, error: Error?) in
result = html as? String
}
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment