reading result from google in java
<p>Hello everyone i getting every time this error in my response while reading google search result using socked :</p>

<pre>HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/search?q=java
Content-Type: text/html; charset=UTF-8
Date: Tue, 26 Feb 2013 10:57:46 GMT
Expires: Thu, 28 Mar 2013 10:57:46 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 232
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN


301 Moved
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/search?q=java" rel="nofollow">here</A>.
</pre>

<p>Here is my code what i m doing</p>

<pre> 
    public String readGoogle(String keyword, int page) {
        String content="";         
        try {
          Socket s = new Socket("google.com",80);
          PrintStream p = new PrintStream(s.getOutputStream());
          p.print("GET /search?q="+keyword+"&start="+page+" HTTP/1.1\r\n");
          p.print("User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n");
          p.print("Connection: close\r\n\r\n");

          InputStreamReader in = new InputStreamReader(s.getInputStream());
          BufferedReader buffer = new BufferedReader(in);

          String line;      

          while ((line = buffer.readLine()) != null) {              
            content += line;            
          }
        }catch(Exception e)  { e.printStackTrace(); }
        return content;
    }
</pre>

<p>Please tell me how to resolve this error, i m stuck here</p>
