android - WebView, get text from IFrame source -


i have webview in load html content.

part of content iframe (name=testframe). trying get text ("currently not available") iframe source, unfortunately below code not working me.

this output of code:

i/system.out: iframe text: <html><head> 

iframe location in html source:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> </head> <body style="background-color:#dfdfdf"> <iframe src="" name="testframe" width="800" height="500" align="left"         scrolling="no" marginheight="0" marginwidth="0" frameborder="0">  </iframe> </body> </html> 

content of iframe:

<html xmlns="http://www.w3.org/1999/xhtml"> <head>  ... </head>  ... <body> <div align="center">     <p>connected to: <b>test.com</b> @ port <b>80</b>...</p> <meta http-equiv="refresh" content="0; url=http://alink.com/info.pdf">  <div align="center"> <span class='htmlerror'> <b>currently not available</b> //get text </span> <br /><br /> <a href="javascript:window.close();"></a> </div> </body> </html> 

my code pieces:

} ... class myjavascriptinterface     {         @javascriptinterface         public void processhtml(string html)         {             system.out.println("iframe text: " + html);          }     } ...  w.getsettings().setjavascriptenabled(true); w.addjavascriptinterface(new myjavascriptinterface(), "htmlout"); w.setwebviewclient(new webviewclient() { @override public void onpagefinished(webview view, string url) {  if (pd.isshowing()) {     pd.dismiss();     }     view.loadurl("javascript:window.htmlout.processhtml('<html>'+document.getelementsbytagname('html')[0].innerhtml+'</html>');"); } 


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -