How to get a web page source code with GeokoView

三世轮回 提交于 2020-01-03 06:00:53

问题


I am an android developer and I know about GeokoView recently. I can get source code of a web page by android WebView (java code).

However with my new website, android Webview can't load the webpage but GeokoView can. Now I want to get source code of a web page by GeokoView. Is there any body know the solution to resolve this problem ?

Thank in advance


回答1:


As far as I know, you cannot use GeckoView to get the source code, but the geckoview library does have GeckoWebExecutor. Take a look at the fetch method and the WebResponse it returns.

By converting the WebResponse.body InputStream to a String you can get the source code.



来源:https://stackoverflow.com/questions/57971009/how-to-get-a-web-page-source-code-with-geokoview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!