pyGoogle

pyGoogle to prosta biblioteka umożliwiająca wykonywanie zapytań w wyszukiwarce google. Oto przykładowy kod:
#!/usr/bin/env python
import google
google.setLicense('tutaj klucz google api')
data = google.doGoogleSearch('fraza szukana')
print data.meta.searchTime

x = 0
while x < len(data.results):
	print data.results[x].title + " - " + data.results[x].URL
	x += 1
data.results z przykładu to lista postaci: ['URL', 'cachedSize', 'directoryCategory', 'directoryTitle', 'hostName', 'relatedInformationPresent', 'snippet', 'summary', 'title']
print google.doGetCachedPage('adres www') - wyświetli daną stronę z cache google
print google.doSpellingSuggestion('pithon') - sugestia pisowni google
RkBlog

Podstawy Pythona, 14 July 2008

Comment article
Comment article RkBlog main page Search RSS Contact