Nv7-GitHub / googlesearch

A Python library for scraping the Google search engine.
https://pypi.org/project/googlesearch-python/
MIT License
430 stars 110 forks source link

parameter num_results related error #51

Closed lovbatra closed 1 year ago

lovbatra commented 1 year ago

for j in search(query, num_results=15): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: search() got an unexpected keyword argument 'num_results'

code: from googlesearch import search

def search(query): results = [] for j in search(query, num_results=15): results.append(j) return results

query = input("What do you want to search for? ") results = search(query) print(f"Here are the top {len(results)} results for your search:") for result in results: print(result)

version info Name: googlesearch-python Version: 1.2.3

Python 3.11.3 pip 23.1.1

InscribeDeeper commented 1 year ago

You are calling your self-defined function, which has the same name, but no keyword argument 'num_results' def search(query):