我正在尝试从以下 URL 之一读取字符:http ://www.searchgurbani.com/hukum/sis_ganj
使用以下代码:
String htmltext=null;
String inputLine;
URL urlinstance = new URL(url);
BufferedReader in = new BufferedReader(
new InputStreamReader(urlinstance.openStream()));
while ((inputLine = in.readLine()) != null)
htmltext+=inputLine;
in.close();
htmltext = htmltext.getBytes("UTF-8").toString();
System.out.println("HTMLTEXT"+htmltext);
但是当我试图阅读它时,我无法做到这一点。有人可以告诉我如何使这项工作。
谢谢,阿曼