roosevelt Posted June 17, 2009 Share Posted June 17, 2009 Hi, I am making an application to get the top 10 results from google for a given keyword. I tried two methods but both of them didn't give me the desired result. For example, I simply tried to read the contents of the given URL, "http://www.google.com/search?hl=en&q=test" but it returned a 403 error. So, I thought may be I have to use the Post method, but it returned a 405 error. Any tips or suggestions? Thanks a lot in advance! Link to comment Share on other sites More sharing options...
0 MrA Posted June 18, 2009 Share Posted June 18, 2009 You should be using Google's AJAX search API if you want to programatically search Google. Scraping Google search results like what you're trying to do is against Google's TOS (section 5.3 is the relevant part). Link to comment Share on other sites More sharing options...
0 roosevelt Posted June 18, 2009 Author Share Posted June 18, 2009 Thanks for the info MrA, I wasn't aware of the TOS. What would be a good strategy to incorporate the AJAX Search API in a JAVA Application? I took a quick look at the AJAX API, and the only way I can make it work is incorporating a browser within my application. Link to comment Share on other sites More sharing options...
0 MrA Posted June 18, 2009 Share Posted June 18, 2009 Thanks for the info MrA, I wasn't aware of the TOS. What would be a good strategy to incorporate the AJAX Search API in a JAVA Application? I took a quick look at the AJAX API, and the only way I can make it work is incorporating a browser within my application. Not true. Despite the naming, the AJAX API is intended for ALL users, not just the browser ones. Its called AJAX because it uses JSON as the browser/server interface. See Fash and other non-Javascript Environments in the developers guide. You'll need a JSON parser, which for Java, you can get @ http://www.json.org/java/ Link to comment Share on other sites More sharing options...
Question
roosevelt
Hi,
I am making an application to get the top 10 results from google for a given keyword. I tried two methods but both of them didn't give me the desired result.
For example, I simply tried to read the contents of the given URL, "http://www.google.com/search?hl=en&q=test" but it returned a 403 error.
So, I thought may be I have to use the Post method, but it returned a 405 error.
Any tips or suggestions?
Thanks a lot in advance!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts