Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Results #139

Closed
krypterro opened this issue Apr 27, 2022 · 3 comments
Closed

No Results #139

krypterro opened this issue Apr 27, 2022 · 3 comments

Comments

@krypterro
Copy link

krypterro commented Apr 27, 2022

I can't seem to get any image results, but no errors either. Running Python 3.8.10 on Linux Mint, with a fresh venv.

from google_images_search import GoogleImagesSearch

def main():
  key = "AIzaSyxxxxxxxxxxxxxxxxxxxxq8W9TpSedhHeY"
  cx = "0016904xxxxxxxx366:n-vrnapnina"
  gis = GoogleImagesSearch(key, cx)
 
  search_params = {
    'q': 'superman',
    'num': 10,
    #'fileType': 'jpg',
    #'rights': 'cc_publicdomain',
    #'safe': 'off', ##
    #'imgType': 'imgTypeUndefined', ##
    #'imgSize': 'imgSizeUndefined', ##
  }

  gis.search(search_params=search_params)
  
  print(gis.results())
  
  for image in gis.results():
      print("*")
      image.url
      image.referrer_url
      image.download('covers/')
      image.resize(300, 300)
      image.path
    
main()
@arrrlo
Copy link
Owner

arrrlo commented Apr 27, 2022

Hi,

My first guess is that you misconfigured your custom search project.

Visit https://cse.google.com/cse/all and in the web form where you create/edit your custom search engine enable "Image search" option and for "Sites to search" option select "Search the entire web but emphasize included sites".

@krypterro
Copy link
Author

Right you were, thank you.

@nebula1989
Copy link

Amazing! I had the same issue. Thank you Arrrlo.

@arrrlo arrrlo closed this as completed May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants