/
PlayerInfo.java
36 lines (25 loc) · 915 Bytes
/
PlayerInfo.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
29
30
31
32
33
34
35
36
import java.io.*;
import java.net.*;
class PlayerInfo
{
public static void main (String args[]) throws IOException
{
try {
// Create a URL object
String temp="http://ccnabaaps.hostingsiteforfree.com/folder/phppart.php?q=http://www.espncricinfo.com/india/content/player/253802.html";
URL url = new URL(temp);
// Read all of the text returned by the HTTP server
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String htmlText;
while ((htmlText = in.readLine()) != null) {
// Keep in mind that readLine() strips the newline characters
System.out.println(htmlText);
}
in.close();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}