JAVA
java
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
26
27
28
import java.util.*;
import java.net.*;
/**
* Represents a class that receive a String URL
* and print this HTML souce-code
*
* @author: Rafael Valle
*/
public class Program
{
public static void main(String[] args) {
//String that receive the URL
String url = "digivalle.com.br";
getHTML(url);
}
private static void getHTML(String url) {
URLConnection connection = null;
Scanner sc = null;
String html = "";
try {
connection = new URL("http://" + url).openConnection();
sc = new Scanner(connection.getInputStream());
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run