I have a serious problem. I searched everything through stack overflow and many other sites. each where they give the same solution, and I tried all this, but mi was not able to solve this problem.
I have the following code,
Document doc = Jsoup.connect(url).timeout(30000).get();
Here m, using the Jsoup library, and the result I get is not equal to the actual page source that we see, but right-click on the page -> page source. Many parts are missing from the result that I get with the above line of code. After searching some sites on Google, I saw this method,
URL url = new URL(webPage);
URLConnection urlConnection = url.openConnection();
urlConnection.setConnectTimeout(10000);
urlConnection.setReadTimeout(10000);
InputStream is = urlConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
int numCharsRead;
char[] charArray = new char[1024];
StringBuffer sb = new StringBuffer();
while ((numCharsRead = isr.read(charArray)) > 0) {
sb.append(charArray, 0, numCharsRead);
}
String result = sb.toString();
System.out.println(result);
.
, , , charSet - -. ? java. crawler4j, . , . m . , . , !