File size: 2,788 Bytes
1c6923c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---

tags:
  - web-scraping
  - dataset-tools
---


> **Project page:** [https://huggingface.co/spaces/Anirudh1950/Image_web_scraper](https://huggingface.co/spaces/Anirudh1950/Image_web_scraper)

# Google Image Scraper

A simple and efficient command-line tool to download images from Google Images using Python. This script allows you to quickly gather images for your machine learning, computer vision, or any other project that requires image datasets.

## Features

- Download multiple images with a single command
- Supports custom download directory
- Multi-threaded downloads for improved performance
- Automatic file type detection
- Progress bar for download tracking
- Cross-platform support (Windows, Linux, macOS)

## Prerequisites

- Python 3.6 or higher
- pip (Python package manager)

## Installation

1. Clone the repository:
   ```bash

   git clone https://github.com/rudzz1950/Web-scraper.git

   cd Web-scraper

   ```

2. Install the required dependencies:
   ```bash

   pip install -r requirements.txt

   ```

## Usage

Basic usage:
```bash

python scraper.py "search query"

```

### Options

- `-c, --count`: Number of images to download (default: 10)
- `-d, --directory`: Directory to save downloaded images (default: Downloads/google-image-scraper/)
- `-t, --threads`: Number of download threads to use (default: 4)

### Examples

1. Download 20 images of cats:
   ```bash

   python scraper.py "cats" -c 20

   ```

2. Download 50 images of dogs to a custom directory:
   ```bash

   python scraper.py "dogs" -c 50 -d /path/to/save/directory

   ```

3. Use 8 threads for faster downloads:
   ```bash

   python scraper.py "mountains" -c 30 -t 8

   ```

## Output

Downloaded images will be saved in the following structure:
```

<download_directory>/

└── <search_query>/

    β”œβ”€β”€ image1.jpg

    β”œβ”€β”€ image2.jpg

    └── ...

```

## Dependencies

- requests - For making HTTP requests
- tqdm - For progress bars
- filetype - For file type detection

## License

This project is open source and available under the [MIT License](LICENSE).

## Disclaimer

This tool is for educational purposes only. Please respect copyright laws and terms of service of the websites you're scraping. The developers are not responsible for any misuse of this tool.

## Running it

This tool queries Google Images, which blocks cloud servers, so run it locally: `pip install -r requirements-original.txt && python scraper.py "cats" -c 50`.


---
Source code: https://github.com/rudzz1950/Image_web_scraper

## Run locally

```bash

pip install -r requirements.txt

python app.py

```
`app.py` is a Gradio app; the original project scripts are unchanged alongside it.