ultralytics / google-images-download

Google/Bing Images Web Downloader
https://ultralytics.com
GNU Affero General Public License v3.0
294 stars 84 forks source link

missing argument 'keywords' #6

Open buszonos opened 4 years ago

buszonos commented 4 years ago

Hi, My problem is: every time I try to run this module with 'search' argument and without 'keywords' argument, i get error message "Uh oh! Keywords is a required argument[....]". When i use 'keywords' argument only, module will use google images as a source, and it obviously won't download any images. When I use both, it will still use google images url. I will provide you part of my code if it helps you.

import bing_scraper response = bing_scraper.googleimagesdownload() arguments = {"search": 'honeybees on flowers', "limit": 10, "download":True, "chromedriver":r"C:\Users\User\Desktop\python\chromedriver.exe" }

response.download(arguments)

gaushh commented 4 years ago

cd C:\Users\username\google-images-download python bing_scraper.py --search 'honeybees or flowers' --limit 10 --download --chromedriver C:\Software\chromedriver

Run this from command line after cloning the repo. Should work.

buszonos commented 4 years ago

Uhh, i forgot to mention i want to use this module from other python file, not from terminal

gaushh commented 4 years ago

Well i too am trying to figure out the same. Let me know if you find a solution. :p

mohitsingh538 commented 3 years ago

@buszonos Try this. Download this file, unzip and replace it with your original bing_scraper.py file. I have replaced all Google URLs with that of Bing and now it's taking argument --keywords without using --search bing_scraper.py.zip

glenn-jocher commented 7 months ago

I understand you want to use the module from within another Python file, not from the terminal. You can achieve this by importing the module and making a function call with the required arguments. If you encounter any issues, feel free to ask for help. Good luck!

Neltherion commented 5 months ago

@buszonos Try this. Download this file, unzip and replace it with your original bing_scraper.py file. I have replaced all Google URLs with that of Bing and now it's taking argument --keywords without using --search bing_scraper.py.zip

This should be merged with the main branch.