I’m trying to get data from HTML table but when I’m connecting to the website it is not returning what it is showing on in the browser.
This is what I’m expecting to get by looking at the html result:
<div id="ResultsContainer">
<div id="Pagination"><div class="left">displaying: 601 - 633 of 633</div><div class="right">
...
and here is what i’m getting:
<div id=ResultsContainer>
<p class=RedBold10pt>Search returned no matches</p>
</div>
Here is my Java Code
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.15 Safari/536.5");
request.setURI(new URI("http://results.active.com/pages/searchform.jsp?posted_p=t&numPerPage=50&page=0&rsID=10505&queryType=division#VIEW"));
HttpResponse response = client.execute(request);
BufferedReader in = null;
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String page = sb.toString();
System.out.println(page);
What could be the cause of this?
The problem was with Google AppEngine. I had to downgrade to 1.6.3 from 1.6.4