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

Stefan Sonnenberg-Carstens stefan.sonnenberg at pythonmeister.com
Sat Nov 20 11:30:44 CET 2010


Am 20.11.2010 10:37, schrieb Petar Milin:
> Hello!
> Can anyone help me with getting number of hits from Google, but with 
> restricton on domain (e.g., .edu) and language (e.g., lang_de)? I have 
> tried with the Pygoogle (from: http://code.google.com/p/pygoogle/ 
> <http://www.google.com/url?sa=D&q=http://code.google.com/p/pygoogle/&usg=AFQjCNEVyJd1MJ8TZRxehHaKTd0UcRrJ-w>): 
>
> from pygoogle import pygoogle
> word = u'something'
> request_word = word.encode('utf-8')
> request = ('%s+site:.edu' % request_word)
> g = pygoogle(request)
> g.get_result_count()
>
>
> Now, I realized that domain restriction works, but language does not, 
> since it cannot be specified in request like domain in example above.
> Please, help! Is this possible with the Pygoogle? If not, how can I 
> make that happen?
>
> Thanks!
> PM
>
>
See below

word = u'something'
request_word = word.encode('utf-8')
request = ('%s site:.edu options lang:de' % request_word)
g = pygoogle(request)
g.get_result_count()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101120/66bb85b8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stefan_sonnenberg.vcf
Type: text/x-vcard
Size: 231 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20101120/66bb85b8/attachment.vcf>


More information about the Python-list mailing list