DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse((new URL(myUrl)).openStream());
我对此感到异常......
答案 0 :(得分:0)
你可以尝试:
....
URL url = new URL(myURL);
URLConnection connection = url.openConnection();
connection.connect();
InputStream input = connection.getInputStream();
Document doc = docBuilder.parse(input);