I'm building an app which needs to:
- Open a URL and show the webpage in a webview;
- Parse che HTML code with JSoup in order to extract all the links in the webpage.
Code i'm using for showing the webpage in the webview:
WebView webview = new WebView(this);
setContentView(webview);
webview.loadUrl("http://www.mywebpage.com");
The JSoup request:
Document doc = Jsoup.connect("http://www.mywebpage.com").get()
Now i nave a doubt to clarify: will my URL receive two different HTML requests from the app? If so, is there a way to perform both the activities (render the webpage and parse the HTML source) downloading the webpage with only one request?
I'm thinking to load the URL through an HTTPUrlConnection, then send the HTML to the engine forma the webview rendering and to Jsoup for the parsing. Could it work?