Roy пре 6 година
родитељ
комит
a1603d2710
4 измењених фајлова са 35 додато и 1 уклоњено
  1. 5
    0
      .idea/ZCW-Fido-URLFetch.iml
  2. 14
    0
      pom.xml
  3. 16
    1
      src/main/java/Main.java
  4. BIN
      target/classes/Main.class

+ 5
- 0
.idea/ZCW-Fido-URLFetch.iml Прегледај датотеку

11
     </content>
11
     </content>
12
     <orderEntry type="inheritedJdk" />
12
     <orderEntry type="inheritedJdk" />
13
     <orderEntry type="sourceFolder" forTests="false" />
13
     <orderEntry type="sourceFolder" forTests="false" />
14
+    <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
15
+    <orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-api:5.2.0" level="project" />
16
+    <orderEntry type="library" name="Maven: org.apiguardian:apiguardian-api:1.0.0" level="project" />
17
+    <orderEntry type="library" name="Maven: org.opentest4j:opentest4j:1.1.0" level="project" />
18
+    <orderEntry type="library" name="Maven: org.junit.platform:junit-platform-commons:1.2.0" level="project" />
14
   </component>
19
   </component>
15
 </module>
20
 </module>

+ 14
- 0
pom.xml Прегледај датотеку

19
             </plugin>
19
             </plugin>
20
         </plugins>
20
         </plugins>
21
     </build>
21
     </build>
22
+    <dependencies>
23
+        <dependency>
24
+            <!-- jsoup HTML parser library @ https://jsoup.org/ -->
25
+            <groupId>org.jsoup</groupId>
26
+            <artifactId>jsoup</artifactId>
27
+            <version>1.11.3</version>
28
+        </dependency>
29
+        <dependency>
30
+            <groupId>org.junit.jupiter</groupId>
31
+            <artifactId>junit-jupiter-api</artifactId>
32
+            <version>5.2.0</version>
33
+            </dependency>
34
+    </dependencies>
35
+
22
     
36
     
23
 </project>
37
 </project>

+ 16
- 1
src/main/java/Main.java Прегледај датотеку

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
 public class Main {
9
 public class Main {
2
-    public static void main(String[] args) {
10
+    public static void main(String[] args) throws IOException {
3
         //ask for a url
11
         //ask for a url
4
         // fetch the url
12
         // fetch the url
5
         // print the url
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
 }

BIN
target/classes/Main.class Прегледај датотеку