In my android app I use a asynctask to get a html source code from a website.
For that I use HttpURLConnection like that:
protected Void doInBackground(Void... v) {
try {
URL url = new URL("http://xx.com/test.pl");
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
InputStream inputStream = httpURLConnection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String temp;
while ((temp = bufferedReader.readLine()) != null) {
//Pattern pattern = Pattern.compile("&sid=(.*?)\"");
//Matcher match = pattern.matcher(temp);
System.out.println(temp);
Log.e("temp_HoleKunde", temp);
}
}
catch(Exception exe) {
exe.printStackTrace();
}
return null;
}
I always used this when I parse a Website and it always runs fantastic.
But now I have a very serious problem. The source code, which I log on logcat, isn’t the full source. Only half of it is showing.. or more and sometimes less.
How can I get the full source code like on the browser?
Logs aren’t meant to print out thousands of lines of code. I’m sure that it will display the whole source code once you set it to a
TextView.