🖼️

Tải ảnh từ danh sách link trong Excel

Đọc file Excel chứa hàng nghìn link ảnh và tải tất cả về máy, đặt tên theo mã sản phẩm.

Image ⭐⭐ Intermediate ⏱️ 5 phút

😫 Vấn đề (The Pain Point)

Nhà cung cấp gửi cho bạn file Excel danh sách sản phẩm, trong đó hình ảnh là… đường link (URL). Bạn cần tải 2000 cái ảnh đó về để up lên Shopee.

Cách làm thủ công: Click vào link -> Chuột phải “Save as” -> Copy mã sản phẩm paste vào tên file -> Save. Lặp lại 2000 lần. (Cực hình!)

🚀 Giải pháp Agentic (The Solution)

Tool đọc file Excel, vừa tải ảnh vừa đổi tên file theo mã SKU cho bạn.

Tính năng:

  • Map Columns: Chỉ định cột nào là Link, cột nào là Tên file.
  • Error Log: Link nào chết (404) sẽ được ghi lại báo cáo.
  • Multi-thread: Tải song song 10 ảnh cùng lúc, siêu nhanh.

Excel Image Downloader Screenshot

🤖 Engineering Prompt (Copy & Paste)

**Role:** Python Data Developer

**Task:** Create a "Batch Image Downloader from Excel".

**Requirements:**
1.  **Tech Stack:** Python, `tkinter`, `pandas`, `openpyxl`, `requests`.
2.  **GUI:**
    *   Select Excel File.
    *   Dropdowns to select:
        *   "URL Column" (e.g., Image_Link).
        *   "Filename Column" (e.g., SKU_Code).
    *   Select Output Folder.
    *   Download button.
3.  **Logic:**
    *   Read Excel using Pandas.
    *   Iterate rows.
    *   Download image from URL.
    *   Save as `[SKU_Code].jpg` in Output Folder.
    *   **Fail-safe:** If filename empty, use timestamp. Handle timeouts.
    *   Display progress bar and "Success/Fail" count.
4.  **Deliverables:**
    *   `excel_downloader.py`
    *   `run.bat`
    *   `requirements.txt`

**Context:** E-commerce operations managing product catalogs provided by suppliers.

🧠 Giải mã Prompt

  • Column Mapping: Mỗi file Excel có tên cột khác nhau. Việc cho user chọn cột (Dropdown) giúp tool linh hoạt với mọi file báo cáo.
  • Fail-safe: Link ảnh thường hay bị lỗi (hết hạn, server die). Tool cần xử lý mượt mà (bỏ qua và báo lỗi) thay vì crash chương trình.

🛠️ Hướng dẫn

  1. Copy Prompt -> Paste.
  2. Chạy run.bat.
  3. Chọn file Excel -> Chọn cột Link & Cột Tên -> Tải về.

Workflows liên quan

Khám phá danh mục khác

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.