9. Working with HTTP
Activity 1: Using the jsoup Library to Download Files from the Web
Solution
The program is relatively short. The main task is to figure out the CSS query for the select() method call:
- Create a class named
Activity1. - In
main(), start atry-catchblock        try {                     } catch (IOException e) {             e.printStackTrace();         } - Inside the
tryblock, use theJsouplibrary to download the contents of the remote Web page located at https://packt.live/2BqZbtq. This will result in the Web page contents stored in aDocumentobject.        String url = "http://hc.apache.org/";           &...