0
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse((new URL(myUrl)).openStream());

我对此有例外....

4

1 回答 1

0

你能试一下吗:

....
URL url = new URL(myURL);
URLConnection connection = url.openConnection();
connection.connect();
InputStream input = connection.getInputStream();
Document doc = docBuilder.parse(input);

URLConnection 启发 getContent() return null

于 2012-07-10T06:45:42.253 回答