Trying to get text from page but getting this output:
������ ������ done
it needs to be:
привет привет done
public static void main(String... args) throws IOException {
URL url = new URL("https://script.google.com/macros/s/AKfycbzvHqXSXY0LgwfFeltbNS_iYCcge8re0s-uY0-lvSJ0uuMDENoS/exec?message=" + "hello" + "&langin=en&langout=ru");
URLConnection con = url.openConnection();
InputStream in = con.getInputStream();
String encoding = con.getContentEncoding();
// encoding = "UTF-8";
encoding = encoding == null ? "UTF-8" : encoding;
String body = IOUtils.toString(in, encoding);
System.out.println(body);
Document doc = Jsoup.connect("https://script.google.com/macros/s/AKfycbzvHqXSXY0LgwfFeltbNS_iYCcge8re0s-uY0-lvSJ0uuMDENoS/exec?message=" + "hello" + "&langin=en&langout=ru").get();
System.out.println(doc.text());
System.out.println("done");
}