如何使用JRex获取页面源代码?

时间:2010-08-05 23:22:15

标签: java

如何使用JRex访问网页源代码?

1 个答案:

答案 0 :(得分:0)

//WebNavigation navigation = null;
//URI uri = null;

navigation.loadURI(uri, WebNavigationConstants.LOAD_FLAGS_NONE, null, null, null);
Document doc = navigation.getDocument();
Element ex = doc.getDocumentElement();
System.out.println(ex.getTextContent()); //prints page source