Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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'

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I assume the library you use was updated, and got rid of the tld keyword-arg in search. Read up on their documentation, and work around it.

What I would not recommend is installing an older version of the library to get the feature back. There’s probably a reason why this was removed in the first place.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading