I need to read a specific HTML of a div that is loaded in a webview
doc = web.stringByEvaluatingJavaScript(from: "document.body.innerHTML")!
With the above code I get the HTML in the webview and turn it into a string
Now I'm trying to get a particular div that HTML
<div id="status_load" name="status_load">DESLIGADO</div><p>Luz <a href="?pin=LIGADO"><button>Ligar</button></a> <a href="?pin=DESLIGADO"><button>Desligar</button></a></p>
I tried to do so, but do not return anything!
web.stringByEvaluatingJavaScript(from: "document.getElementById('status_load').value")!
Does anyone know how to do this?