Google Results and Python

Reply

Join Date: Jan 2009
Posts: 8
Reputation: betatype is an unknown quantity at this point 
Solved Threads: 0
betatype betatype is offline Offline
Newbie Poster

Google Results and Python

 
0
  #1
Jan 5th, 2009
Question about gathering search results for a phrase with Python. I wrote a simple script for my personal SEO purposes that would go out and collect the top 30 search results on Google and then return a list of those URL's. The trouble is everytime I try to run my script Google starts returning an error about the search not being allowed. The URL I'm using works fine if entered manually but Google seems to know I'm trying to get access through a script. Is there a way around this or an API that I should be using? My searches into the subject haven't given me much.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 117
Reputation: mn_kthompson is an unknown quantity at this point 
Solved Threads: 21
mn_kthompson mn_kthompson is offline Offline
Junior Poster

Re: Google Results and Python

 
0
  #2
Jan 5th, 2009
Google does not allow searches from any devices that does not provide a commonly used agent string. When you gather data using python the agent string is something like "python 2.6". Google doesn't allow that because they don't want people using scripts to gather their search results.

The answer is to spoof your agent string. I recently wrote up a script that does something similar to what you're trying to do. I wrote a blog entry about it and included sample code that you might want to check out.
http://blackfistsecurity.blogspot.co...king-with.html
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC