๐Ÿ“ฆ wasuaje / searchgoogle

๐Ÿ“„ googlesearch.py ยท 16 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16import sys
sys.path.append('xgoogle')

from xgoogle.search import GoogleSearch, SearchError
try:
  gs = GoogleSearch("neo4j")
  gs.results_per_page = 150
  results = gs.get_results()
  for res in results:
    print res.title.encode("utf8")
    print res.desc.encode("utf8")
    print res.url.encode("utf8")
   # print
except SearchError, e:
  print "Search failed: %s" % e