I am try to use the xgoogle python library for the purpose of me entering a term, and it returning how many search results there are for it. Here is my code:
from xgoogle.search import GoogleSearch
word1 = 'aardvark'
word2 = 'ablaze'
words = word1,"",word2
gs = GoogleSearch(words)
num = gs.num_results
print num
This is returning 'Traceback (most recent call last):
File "F:\google whack\SearchTest.py", line 6, in <module>
num = gs.num_results
File "C:\Python27\xgoogle\search.py", line 89, in num_results
page = self._get_results_page()
File "C:\Python27\xgoogle\search.py", line 189, in _get_results_page
safe_url = [url % { 'query': urllib.quote_plus(self.query),
File "C:\Python27\lib\urllib.py", line 1245, in quote_plus
return quote(s, safe)
File "C:\Python27\lib\urllib.py", line 1236, in quote
if not s.rstrip(safe):
AttributeError: 'tuple' object has no attribute 'rstrip''
If anybody knows how to make this return the number of results, help is very much appreciated!!! Thanks!!!