This is a Google Image Crawler based on google custom search engine.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
In order to use Google Image Crawler, you must have the following installed:
To install the dependencies, enter the following in your terminal:
$ cd google-image-crawler
$ npm install
Create a file named .env
in the root directory. This file should contain:
CSE_ID=your-custom-search-engine-id-here
API_KEY=your-api-key-here
Wait a little time for installing and finally project is done.
Here are some npm scripts about Google Image Crawler that I had set for project.
To start the app, make sure you're in the project directory and use CLI. Format is below:
npm start <to be searched> <page>
or
npm start <first to be searched> <page> <second to be searched> <page> ...
which will create a folder named downloads
in the root directory and start downloading images that finally save in the folder.
Powered by del module, you can delete images folder under the downloads
.
npm run delete
which will delete all the folders and images under the downloads
. Or you can type
npm run delete <folder>
or
npm run delete <folder1> <folder2> ...
Google deprecated their public Google Images API, so to search for images you need to sign up for Google Custom Search Engine. Here are the steps you need to do:
You can do this here: https://cse.google.com/cse.
Do not specify any sites to search but instead use the "Restrict Pages using Schema.org Types" under the "Advanced options".
For the most inclusive set, use the Schema: Thing
. Make a note of the CSE ID.
In your search engine settings, enable "Image search":
Register a new app and enable Google Custom Search Engine API here: Google Developers Console. Make a note of the API key.
- 游富荃(Fu Chuan Yu) - Portfolio
This project is licensed under the MIT License - see the LICENSE file for details