Re: [Pygoogle-discuss] Installation questions
Brought to you by:
bluecoat93
From: Mitchell H. <mh8...@gm...> - 2008-01-10 19:23:06
|
Hello, I emailed about how to install PyGoogle several months back. For a while, I found another way to do my programming task, but as Google resists many of my crawler requests, I think I may have to use PyGoogle. Right now, I am trying to run the basic code below to see if I've installed PyGoogle correctly: import google google.LICENSE_KEY = '[the key that I got from Google]' data = google.doGoogleSearch('python') and I keep getting the error faultType: <Fault SOAP-ENV:Server: Exception from service object: Invalid authorization key: '[the key I got from Google]' Yet, I'm positive I didn't enter my google key incorrectly. I went to the Google Base Data API page, where it says 'your key is [the key I got from Google]' and 'This key is good for all URLs in this domain: http://www.google.com.' I'm thinking maybe I again may not have install PyGoogle correctly. Here is what I did: 1. Downloaded the Zip file of PyGoogle from Source Forge and saved it on my desktop 2. Copied and pasted the PyGoogle folder into my Python25 directory where I also have my file GoogleKey.txt 3. Typed 'python python setup.py install' so that several compiled python files (with a black shadow instead of no shadow for normal .py files) like google.pyc and googlesoapfacade.pyc were added to my Python25 directory. Is there anything I did incorrectly, or anything additional I need to do to install PyGoogle? Finally, if I wanted to get the number of webpages linking to a particular domain name (say YouTube.com) from Google, that is, the information you get when you type 'link:YouTube.com' in the Google search bar, is this something I can do with PyGoogle? Thank you very much, Mitch On Jul 17, 2007 1:42 AM, Chris Spencer <chr...@gm...> wrote: > On 7/17/07, Mitchell Hoffman <mh8...@gm...> wrote: > > Hello, > > > > I am brand new to PyGoogle and Python in general. I am trying to write > a > > spider to retrieve the number of results from a simple search engine > query > > (have the search engine search for all the terms in a column of an Excel > > spreadsheet and then return the number of results for each term). > > > > I tried looking on http://www.google.com/apis/ to find googlekey.txt, > but > > couldn't find it. Does anyone know where it is? > > The file googlekey.txt is something you have to create. In your Google > account there's a link somewhere (Google for it) reading something > like "email me my Google Key". Click that, copy the key from the > email, and save it to that text file. > > > Second, to install PyGoogle, I ran Setup.py from IDLE in my Python25 > drive. > > Then I opened another IDLE window and typed 'import google' and I got > > error saying the google module could not be found. So I manually copied > the > > four py files in PyGoogle ( Google.py, GoogleSoapFacade.py, > Googletest.py, > > and SOAP.py) into my Python 25. Now, after running SOAP.py, I am able > to do > > 'import google' without an error. Did I successfully install PyGoogle? > Is > > this the right way to install PyGoogle or will I experience problems > later? > > In general, you'll want to run setup.py from a command line, in the > form "python setup.py install" to install packages. It might have > worked from IDLE if you have run it with the "install" argument, but > it's easier to simply use the command line. > > > Third, is PyGoogle necessary to simply scrape the number of results? > Will > > simpler tools like UrlLib2 and UrlLib2 work for, or will Google > resist/block > > them? > > > If you're not doing large numbers of queries, you can get away with > urllib. Otherwise, Google will probably block you. After all, that is > why they provide an API. > > Regards, > Chris > |