-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
25 lines (21 loc) · 753 Bytes
/
Main.java
File metadata and controls
25 lines (21 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.yurii.salimov.lesson11.task01;
import java.io.IOException;
import java.net.URL;
import java.util.List;
/**
* 11.1 Вывести на экран все ссылки, которые содержатся в скачанном HTML документе.
*
* @author Yuriy Salimov (yuriy.alex.salimov@gmail.com)
* @version 1.0
*/
public class Main {
public static void main(String args[]) throws IOException {
final URL url = new URL("http://alexcoffee.com.ua");
final Parser parser = new Parser(url);
final String page = parser.getHtml();
System.out.println(page);
System.out.println();
final List<URL> listURL = parser.getUrls();
listURL.forEach(System.out::println);
}
}