google-images-download

hardikvasaMIT更新放缓 有专家点评

一条命令就能从 Google 图片批量抓取几百张图片,支持按颜色、尺寸等条件筛选,适合快速搭建图像数据集。

Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!

暂无版本8,707star +2 / 7 天2,081fork同步于 2026-11-11 05:29 UTC

专家点评

上手难度:进阶更新于 2026-11-11

用 Selenium 驱动 Chrome 抓取 Google 图片搜索结果,替代手写爬虫脚本

适用场景

  • 快速构建小规模图像数据集(几百张量级):需要按关键词批量获取图片用于原型验证或教学演示时,直接运行脚本比从零编写 Selenium 抓取逻辑更快
  • 需要按颜色等搜索条件筛选图片:脚本已封装 Google 图片的搜索参数,手动构造 URL 或调用 API 的成本更高
  • 一次性离线抓取任务:不需要常驻服务或增量更新,运行一次拿到图片即可,无需引入 Scrapy 等框架
  • 教学或实验场景:README 明确提示仅限教育用途,适合在受控环境中演示网页抓取流程

踩坑

  • 下载失败是 issue 中反复出现的类型:多个高反应 issue 标题都指向「图片无法下载」「拿不到任何图片」,说明抓取结果对 Google 页面结构和网络环境敏感,实际能拿到的数量常低于请求数
  • 依赖本机 Chrome/Chromium 与 chromedriver:README 明说必须预装浏览器,issue 中也有 chromedriver 相关报错(如 limit 大于 100 时传 json 文件),环境版本不匹配时会直接卡在启动阶段
  • 项目维护活跃度存疑:issue 列表中出现「Can someone merge #298?」这类请求合并的标题,说明修复可能长期滞留在 PR 中,遇到问题时不要指望上游快速响应

同类对比

如果只是要现成的图像数据集,直接用公开数据集(如 ImageNet、Open Images)比抓取更稳定;如果需要工程化的抓取管线,考虑 Scrapy 或 icrawler 这类支持多源、可配置重试的框架。

怎么上手

由 README 提炼,执行前请确认
pip install google_images_download
硬件要求按 README 说明

README 未说明显存或 GPU 要求;需本机安装 Chrome 或 Chromium 浏览器,Linux、macOS、Windows 均可运行。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Python 脚本从 Google 图片批量搜索并下载数百张图片到本地

一条命令就能从 Google 图片批量抓取几百张图片,支持按颜色、尺寸等条件筛选,适合快速搭建图像数据集。

核心能力

  • 按关键词搜索并批量下载数百张图片
  • 基于 Selenium 驱动 Chrome 执行 JavaScript 抓取
  • 自动下载并管理 chromedriver 版本
  • 支持命令行参数配置下载选项

容易踩的坑

必须预先安装 Chrome/Chromium 浏览器,否则无法运行;Google 图片现已要求执行 JavaScript,纯 HTTP 方式不可用;下载的图片版权归原作者,README 提示仅限教育用途。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Google Images Download ######################

    Python Script for 'searching' and 'downloading' hundreds of images from Google to the local hard drive!

    Documentation

    • Documentation Homepage <https://hardikvasa.github.io/google-images-download/>__
    • Installation <https://hardikvasa.github.io/google-images-download/installation/>__
    • Input arguments <https://hardikvasa.github.io/google-images-download/arguments/>__
    • Examples and Code Samples <https://hardikvasa.github.io/google-images-download/examples/>__

    Requirements

    Chrome/Chromium browser is required for this tool to work. Google Images now requires JavaScript execution, so Selenium with Chrome is mandatory for all downloads.

    Installation:

    • Linux: apt-get install chromium-browser or apt-get install google-chrome-stable
    • macOS: brew install --cask google-chrome
    • Windows: Download from https://www.google.com/chrome/

    The tool will automatically download and manage the chromedriver using webdriver-manager.

    Disclaimer

    This program lets you download tons of images from Google. Please do not download or use any image that violates its copyright terms. Google Images is a search engine that merely indexes images and allows you to find them. It does NOT produce its own images and, as such, it doesn't own copyright on any of them. The original creators of the images own the copyrights.

    Images published in the United States are automatically copyrighted by their owners, even if they do not explicitly carry a copyright warning. You may not reproduce copyright images without their owner's permission, except in "fair use" cases, or you could risk running into lawyer's warnings, cease-and-desist letters, and copyright suits. Please be very careful before its usage! Use this script/code only for educational purposes.