I have an URL being loaded into a webview, when the loading is complete, I want to get the iframe src that is inside the HTML, and reload the webview with the iframe src.
<iframe frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" scrolling="no" src="https://example.com/abc"></iframe>
In my iOS code, inside webViewDidFinishLoad , I am trying to get the iframe using
webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('iframe').attr('src')"];
This javascript is working in chrome console, however its not working for me.
Can you please help me?