Matthew
Published: December 2025
Share:
Fashion eCommerce is no longer just about text-based product information. Today, product images define everything — from style, color accuracy, fit expectations, fabric texture, variant visibility, and even brand perception.
But for retailers, analytics teams, and catalog managers, extracting thousands of fashion images and classifying them manually is impossible.
This technical guide walks you through:
If you're ready to learn, let’s dive in.
If not?
Actowiz Solutions already provides enterprise-grade image extraction + classification pipelines that handle millions of SKUs across global fashion platforms.
Install:
You'll use:
Example: scraping H&M product images.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from time import sleep
import requests
from PIL import Image
from io import BytesIO
import tensorflow as tf
import numpy as np
import json
browser = webdriver.Chrome()
browser.get("https://www2.hm.com/en_in/men/shop-by-product/t-shirts.html")
sleep(3)
# Scroll for lazy loading:
for _ in range(6):
browser.find_element(By.TAG_NAME, "body").send_keys(Keys.END)
sleep(2)
products = browser.find_elements(By.XPATH, '//article[contains(@class,"product-item")]')
extracted_data = []
for product in products:
img_tag = product.find_element(By.TAG_NAME, "img")
img_url = img_tag.get_attribute("src")
title = product.find_element(By.CLASS_NAME, "item-heading").text
price = product.find_element(By.CLASS_NAME, "item-price").text
extracted_data.append({
"title": title,
"price": price,
"image_url": img_url
})
def download_image(url):
response = requests.get(url)
img = Image.open(BytesIO(response.content))
return img
sample_image = download_image(extracted_data[0]["image_url"])
sample_image.show()
Load the model:
model = tf.keras.applications.MobileNetV2(weights="imagenet")
Prepare images:
def prepare_image(img):
img = img.resize((224, 224))
img_array = tf.keras.applications.mobilenet_v2.preprocess_input(np.array(img))
return np.expand_dims(img_array, axis=0)
Predict:
preds = model.predict(prepare_image(sample_image))
decoded = tf.keras.applications.mobilenet_v2.decode_predictions(preds, top=3)[0]
print(decoded)
Example output:
[('jersey', 0.82), ('t-shirt', 0.71), ('sweatshirt', 0.41)]
import cv2
from sklearn.cluster import KMeans
def get_dominant_color(img, k=3):
img = np.array(img)
img = img.reshape((img.shape[0]*img.shape[1], 3))
kmeans = KMeans(n_clusters=k)
kmeans.fit(img)
return kmeans.cluster_centers_[0] # RGB output
# Convert RGB into nearest human-readable color name.
with open("fashion_images.json", "w") as f:
json.dump(extracted_data, f, indent=4)
Example output:
{
"title": "Relaxed Fit Cotton Tee",
"price": "₹799",
"image_url": "https://image.hm.com/...jpg",
"predicted_category": "t-shirt",
"dominant_color": "White"
}
Most fashion product pages contain:
Modify code:
img_tags = product.find_elements(By.TAG_NAME, "img")
all_images = []
for tag in img_tags:
all_images.append(tag.get_attribute("src"))
# Classify each image in a loop.
A stitched final code version is available and I can deliver it as a clean Python script on request.
Same as Grab tutorial style:
XPath updates break the script.
Slow download times.
Heavy scraping may trigger blocks.
Pre-trained models may misclassify fashion-specific images.
DIY = good for learning. But NOT for production.
If you need:
Then you need Actowiz Solutions' Image Intelligence Suite, powered by:
This tutorial showed you how to:
Modern fashion brands rely on this intelligence to:
And Actowiz Solutions delivers this entire pipeline at enterprise scale.
You can also reach us for all your mobile app scraping, data collection, web scraping , and instant data scraper service requirements!
Our web scraping expertise is relied on by 4,000+ global enterprises including Zomato, Tata Consumer, Subway, and Expedia — helping them turn web data into growth.
Watch how businesses like yours are using Actowiz data to drive growth.
From Zomato to Expedia — see why global leaders trust us with their data.
Backed by automation, data volume, and enterprise-grade scale — we help businesses from startups to Fortune 500s extract competitive insights across the USA, UK, UAE, and beyond.
We partner with agencies, system integrators, and technology platforms to deliver end-to-end solutions across the retail and digital shelf ecosystem.
Extract real-time travel mode data via APIs to power smarter AI travel apps with live route updates, transit insights, and seamless trip planning.
How a $50M+ consumer electronics brand used Actowiz MAP monitoring to detect 800+ violations in 30 days, achieving 92% resolution rate and improving retailer satisfaction by 40%.

Track UK Grocery Products Daily Using Automated Data Scraping across Morrisons, Asda, Tesco, Sainsbury’s, Iceland, Co-op, Waitrose, and Ocado for insights.
Whether you're a startup or a Fortune 500 — we have the right plan for your data needs.