因此,我使用Apache Commons HTTP向网页发出请求。我不能为了我的生活找出如何从页面获取实际内容,我只能得到它的标题信息。我如何从中获得实际内容?从Apache Commons HTTP请求获取页面内容
这里是我的示例代码:
HttpGet request = new HttpGet("http://URL_HERE/");
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(request);
System.out.println("Response: " + response.toString());
谢谢!
我刚刚用这个,但我需要使用Apache的百科全书,因为这是一起有更多的东西。 – Chiggins 2011-03-09 01:39:33