M
mark
Hello,
I want to read the content of some webpages and make some string
comparisons with them (i.e. check if there is some text in it, use some
regular expressions, etc.).
StringBuilder htmlCode = new StringBuilder();
URL url = new URL(fileName);
URLConnection conn = url.openConnection();
conn.connect();
BufferedReader dis = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String inputLine = "";
for(; {
inputLine = dis.readLine();
if (inputLine == null) break;
htmlCode.append(inputLine);
}
It works, but it is very, very slow comparing to browser. Do you know
any ways to speed it up??
Regards, mark
I want to read the content of some webpages and make some string
comparisons with them (i.e. check if there is some text in it, use some
regular expressions, etc.).
StringBuilder htmlCode = new StringBuilder();
URL url = new URL(fileName);
URLConnection conn = url.openConnection();
conn.connect();
BufferedReader dis = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String inputLine = "";
for(; {
inputLine = dis.readLine();
if (inputLine == null) break;
htmlCode.append(inputLine);
}
It works, but it is very, very slow comparing to browser. Do you know
any ways to speed it up??
Regards, mark