Skip to content

Commit

Permalink
Update --chromedriver default, comments and README
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Oct 20, 2020
1 parent 17f6c06 commit 36c7fb2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ This directory contains Bing image-scraping software forked from https://github.

# Requirements

Python 3.7 or later with all of the `pip install -U -r requirements.txt` packages including:
- `selenium`
Python 3.8 or later with all [requirements.txt](https://github.com/ultralytics/google-images-download/blob/master/requirements.txt) dependencies installed, including `selenium`. To install run:
```bash
$ pip install -r requirements.txt
```

# Install
```bash
git clone https://github.com/ultralytics/google-images-download
cd google-images-download
pip install -U -r requirements.txt
$ git clone https://github.com/ultralytics/google-images-download
$ cd google-images-download
$ pip install -r requirements.txt
```

# Use
Expand All @@ -29,7 +31,7 @@ $ python3 bing_scraper.py --url 'https://www.bing.com/images/search?q=flowers' -

or `--search` terms. Images are saved to `./images`. Note that error-producing images may be skipped.
```bash
$ python3 bing_scraper.py --search 'honeybees on flowers' --limit 10 --download --chromedriver /Users/glennjocher/Downloads/chromedriver
$ python bing_scraper.py --search 'honeybees on flowers' --limit 10 --download --chromedriver ./chromedriver

Searching for https://www.bing.com/images/search?q=honeybees%20on%20flowers
Downloading HTML... 3499588 elements: 30it [00:24, 1.21it/s]
Expand Down
17 changes: 7 additions & 10 deletions bing_scraper.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
###### Searching and Downloading Google Images to the local disk ######
# Originally from https://github.com/hardikvasa/google-images-download
# Updated by Evan Sellers <[email protected]> Feb 2020 for bing search with url only
# Updated by [email protected] Feb 2020, requires python 3
# Bing Images and Google Images web scraper
# Requires chromedriver. Download from https://chromedriver.chromium.org/

# Example usage:
# python bing_scraper.py --url 'https://www.bing.com/images/search?q=flowers' --limit 10
# python bing_scraper.py --search 'honeybees on flowers' --limit 10

# python3 bing_scraper.py --url 'https://www.bing.com/images/search?q=flowers' --limit 10 --chromedriver /Users/glennjocher/Downloads/chromedriver
# python3 bing_scraper.py --search 'honeybees on flowers' --limit 10 --chromedriver /Users/glennjocher/Downloads/chromedriver
# https://stackoverflow.com/questions/49162667/unknown-error-call-function-result-missing-value-for-selenium-send-keys-even

import argparse
import codecs
Expand Down Expand Up @@ -129,9 +128,7 @@ def user_input():
help="A word that you would want to prefix in front of each image name", type=str,
required=False)
parser.add_argument('-px', '--proxy', help='specify a proxy address and port', type=str, required=False)
parser.add_argument('-cd', '--chromedriver',
help='specify the path to chromedriver executable in your local machine', type=str,
required=False)
parser.add_argument('-cd', '--chromedriver', help='chromedriver path', type=str, default='./chromedriver')
parser.add_argument('-ri', '--related_images', default=False,
help="Downloads images that are similar to the keyword provided", action="store_true")
parser.add_argument('-sa', '--safe_search', default=False,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pip install -r requirements.txt
# Requires chromedriver. Download from https://chromedriver.chromium.org/

numpy
tqdm
Expand Down

0 comments on commit 36c7fb2

Please sign in to comment.