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

Java 如何使用JRex获取页面源代码?,java,Java,如何使用访问页面源代码 当然,我会去接受所有的答案,因为他们就在那里-我太愚蠢了,因为我战斗了,我应该只接受那些正确的。。。 //WebNavigation navigation = null; //URI uri = null; navigation.loadURI(uri, WebNavigationConstants.LOAD_FLAGS_NONE, null, null, null); Document doc = navigation.getDocument(); Element e

如何使用访问页面源代码

当然,我会去接受所有的答案,因为他们就在那里-我太愚蠢了,因为我战斗了,我应该只接受那些正确的。。。
//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