How do I get the web page contents from a WebView?

后端 未结 7 1867
北恋
北恋 2020-11-22 06:19

On Android, I have a WebView that is displaying a page.

How do I get the page source without requesting the page again?

It seems WebView

7条回答
  •  失恋的感觉
    2020-11-22 07:05

    This is an answer based on jluckyiv's, but I think it is better and simpler to change Javascript as follows.

    browser.loadUrl("javascript:HTMLOUT.processHTML(document.documentElement.outerHTML);");
    

提交回复
热议问题