I am showing a webView to my iOS app (Swift). From the webView I need to retrieve an object (javascript). Using the console I can see that the object I want is called "window.user" but using the following method is returning no results. Is there a way ? Thank you.
if let result = self.webView.stringByEvaluatingJavaScript(from: "document.getElementById(‘window.user’)") {
print(result)
}