Ehsangha / Automated_Corresponding

0 stars 0 forks source link

serpapi module #3

Open soroushdty opened 4 days ago

soroushdty commented 4 days ago

Running main.py throws the following error:

Traceback (most recent call last): File "/home/soroush/Desktop/mailing/main.py", line 4, in import data_gathering File "/home/soroush/Desktop/mailing/data_gathering.py", line 8, in from serpapi import GoogleSearch ImportError: cannot import name 'GoogleSearch' from 'serpapi' (/home/soroush/venv/lib/python3.12/site-packages/serpapi/init.py)

According to serpapi github, the syntax should be:

client = serpapi.Client(api_key=os.getenv("API_KEY"))
results = client.search({
    'engine': 'google',
    'q': 'coffee'
})
Ehsangha commented 1 day ago

Dear @soroushdty Thanks for running the code You should have a serpapi API Key. It's free