views:

127

answers:

1

Hello. Right now, I'm trying to get the results from Google in Java, by searching for a term. I'm using a desktop program, not an applet. That in itself isn't complicated. but then Google gave me a 403 error. Anyways, I added referrer and User Agent and then it worked.

Now, my problem is that I don't get the results page from Google. Instead, I get their script which gets the results page.

My code right now simply uses a GET request on "http://www.google.com/search?q=" + Dork; Then it outputs each line. Here is what I get when I run my program:

<.!doctype html><.head><.title>dork - Google Search<./title><.script>window.google={kEI:"9myaS-Date).getTime()}}};try{}catch(u){}window.google.jsrt_kill=1; align:center}#logo{display:block;overflow:hidden;position:relative;width:103px;height:37px; <./ script><./div>

Lots of stuff like that. I shortened it (A LOT) and put in dots to fit it here.

So my big question is: How do I turn this whole mess into the nice results page I get when searching Google with a browser?

Any help would be seriously appreciated, and I really need the answer fast. Also, please keep in mind that I do NOT want to use Google's API for this.

Thanks in advance!

+2  A: 

Jack is right, take a look at the Google AJAX APIs. If you want nicely formatted results, brush up on your html and css.

omerkudat
Thanks for the answers, but I already said that I did not want to use the Google API.One of the reasons is that it returns a maximum of 32 (I think) results per dork, and I need to retrieve many hundred results.
Cris Carter