Parse all HTML code <p>I need to copy all HTML code on the page.</p> <p>I do so:</p> <pre><code>URL url = new URL(testurl); URLConnection connection = url.openConnection(); connection.connect(); Scanner in = new Scanner(connection.getInputStream()); while(in.hasNextLine()) { htmlText=htmlText+in.nextLine(); } in.close(); </code></pre> <p>But if the page is large, it takes a lot of time.</p> <p>Is there a faster method?</p>