I am trying to fetch HTML element from Webview, I tried existing StackOverflow answer but it's not working for me.
Getting source HTML from a WebView in Cocoa -- not working for me.
@IBOutlet var FacebookWebview: WebView!
let someHTML = FacebookWebview.stringByEvaluatingJavaScript(from: "document.getElementsByClassName('linkWrap noCount')[0].innerHTML;") as NSString?
print("FetchUser:-\(someHTML)")
HTML element --> <div dir="ltr" class="linkWrap noCount">Result</div>
linkWrap noCount is my class name.
Result is the value of the string. -- here I am getting null.
Any help will be appreciated.