How to use swift variables in html code?


I try to use swift variables in html code. Here is my code:


testVar = webView.evaluateJavaScript(“document.getElementsByTagName(‘table’)[1].getElementsByTagName(‘tr’)[1].getElementsByTagName(‘td’)[0].innerText”, completionHandler: nil)




















“(testVar)” Hello
Hello World!    test
Test Hello

        “””, baseURL: nil)


The html task returns “VId” by using the html task document.getElementsByTagName… on the website console. But by using it in xCode, it returns “()”.

Hope you have an idea^^

PS: Sry for my bad english

Powered by WPeMatico


You may also like...

Comments are closed.