pythonpython-3.xgoogle-search

Python GoogleSearch module error : "TypeError: search() got an unexpected keyword argument 'tld' "


Here is my code, it was working properly before I was not getting an error while using it. I don't understand how it happened even though I didn't change with it. :

    results = []
for query in my_list:
    results.append(search(query, tld="com", num=1, stop=1, pause=2))

Error:

results.append(search(query, tld="com", num=1, stop=1, pause=2))
TypeError: search() got an unexpected keyword argument 'tld'

Solution

  • It is from the google python package. it is still working of all the versions.

    version parameters :

    Here is your real problem:

    There is one more python package with the module name as googlesearch

    Link here

    Since it might be installed on your environment, this might be calling this module which does not have these parameters included.

    The BlockBuster Solution is: (tested these both packages on local)