|
@@ -1,7 +1,22 @@
|
|
1
|
+import org.jsoup.Connection;
|
|
2
|
+import org.jsoup.Jsoup;
|
|
3
|
+import org.jsoup.nodes.Document;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+import java.io.IOException;
|
|
7
|
+import java.util.Scanner;
|
|
8
|
+
|
1
|
9
|
public class Main {
|
2
|
|
- public static void main(String[] args) {
|
|
10
|
+ public static void main(String[] args) throws IOException {
|
3
|
11
|
//ask for a url
|
4
|
12
|
// fetch the url
|
5
|
13
|
// print the url
|
|
14
|
+ Scanner in = new Scanner(System.in);
|
|
15
|
+ System.out.println("Enter a url");
|
|
16
|
+
|
|
17
|
+ String url = in.nextLine();
|
|
18
|
+
|
|
19
|
+ Document doc = Jsoup.connect(url).get();
|
|
20
|
+ System.out.println(doc);
|
6
|
21
|
}
|
7
|
22
|
}
|