Is it possible to use Google's advanced search options?

Petar Milin pmilin at ff.uns.ac.rs
Sun Nov 21 10:57:29 CET 2010


Hello!
Thanks so much for the patched Pygoogle!
Also, please, can you give me some more information about how to use 
google search api?
I am a newbie in Python, and I still try to cope with it. Thanks to some 
experience in other
programing languages, I think I progress well, but I am not a 
professional user/programer;
quite far from that.

Best,
Petar

On 20/11/10 21:27, Stefan Sonnenberg-Carstens wrote:
> Am 20.11.2010 20:24, schrieb Petar Milin:
>> Thanks so much! However, 'options lang:de' does not exactly the same
>> as would 'lr=lang_de'? Am I right?
> You're right.
>> Since I need number of hits, I would like to have the best, most
>> correct values! :-)
>>
>> Sincerely,
>> PM
>>
>> On Sat, Nov 20, 2010 at 12:00 PM,<python-list-request at python.org>  
>> wrote:
> I took a look into pygoogle source code.
> It does not send the 'lr' parameter to google.de (as it does not with 
> many more ...).
> I patched it to enable the following (what you needed):
>
> >>> from pygoogle import pygoogle
> >>> g = pygoogle('linux site:.edu')
> >>> g.lr = 'lang_de'
> >>> g.pages = 2
> >>> print 'German',g.get_result_count()
> German 3910
> >>> g.lr = 'lang_en'
> >>> print 'English',g.get_result_count()
> English 1140000
> >>> g.lr = 'lang_cn'
> >>> print 'Chinese',g.get_result_count()
> Chinese 1210000
> >>>
>
> I have attached my patched version of pygoogle.
> BTW: the google search api is very straight forware.
> Perhaps it is easier to create a custom bot to do your queries.
> Cheers,




More information about the Python-list mailing list