问题
When i inspect an website with Chrome
i can to see some iframe
data like this:
Example Chrome inspect
I did the following solutions :
- I can inspect WebView to get iFrame element, but i cant Log these content (Like input tag, etc...).
- I try to get new recaptcha token from iframe link, but received token not valid for its services.
- I tried to get this amount of token using some JavaScript code but I always received null
it try to get all content by this code:
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
view.getSettings().setLoadsImagesAutomatically(true);
Log.d(TAG, "onPageFinished: " + url);
if (url.startsWith(MyApp.LOGIN_URL))
chkLogin.postDelayed(() -> webView.loadUrl("javascript:window.HTMLOUT.processHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');"),300);
}
But i got this result for iframes:
<iframe src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=-&co=..&hl=en&v=&size=invisible&cb=j2nwbbdqkt4c" width="256" height="60" role="presentation" name="a-axd1alpz93t" frameborder="0" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox">(no content in result)</iframe>
So, How to get iFrame Content in android WebView?
来源:https://stackoverflow.com/questions/59412314/how-to-inspect-all-elements-in-android-webview