Zoro has over 12 million products, tools, equipment, and industrial supplies. Zoro is easy to use, a one-stop shop for businesses and individuals looking for products with detailed descriptions, pricing, and availability. With millions of visitors a month, Zoro is a big player in the industrial supply market.
This blog will show you how to extract data from Zoro using Python and the Crawlbase Crawling API. You will learn:
How to scrape Zoro search results.
Get product details like pricing, stock status, and specifications.
Handle JavaScript-rendered content and pagination.
Scraping Zoro can be very useful for businesses, researchers, and developers. With so many products and so much detail, Zoro is a treasure trove of data for analysis and market research. Here’s why:
1. Market Research
Get product information, including specifications, pricing, and availability, to analyze market trends and find top products in different categories.
2. Price Comparison
Use Zoro data to compare prices across competitors to make informed buying decisions or adjust your pricing to stay competitive.
3. Inventory Management
Track product availability and stock status to optimize your inventory and avoid stockouts or overstocking.
4. Data for E-commerce Projects
Scraped data from Zoro can be used to build or enhance e-commerce platforms, product comparison tools, or catalog management systems.
5. Business Intelligence
See customer demand and product popularity by analyzing Zoro’s product listings and reviews.
Key Data Points to Extract from Zoro
When scraping Zoro, you need to extract the right data points to get meaningful insights. Here’s what to focus on:
Crawlbase Crawling API for Zoro Scraping
The Crawlbase Crawling API is perfect for scraping JavaScript-rendered websites like Zoro. It handles dynamic content, bypasses anti-scraping measures, and makes managing pagination simple.
To use Crawlbase, install its Python library using:
1
pip install crawlbase
After signing up for Crawlbase, retrieve your API token from the dashboard. This token is required for all requests. Crawlbase provides two types of tokens. A normal token for static sites and a JS Token for JS-rendered sites. For Zoro, you need a JS token. Crawlbase offers 1,000 requests free for its Crawling API for an easy start.
Crawlbase Crawling API allows you to render JavaScript with the ajax_wait option and handle slower page loads using page_wait. There are many other options you can use with Crawlbase Crawling API; you can read about them here.
# URL of Zoro search page url = "https://www.zoro.com/search?q=tools&page=1"
# Fetch page with Crawlbase response = crawling_api.get(url, options)
if response['headers']['pc_status'] == '200': html_content = response['body'].decode('utf-8') print("Data fetched successfully!") else: print("Failed to fetch data.")
This configuration sets the stage for building scrapers for Zoro’s listings and product pages.
Preparing for Zoro Data Scraping
Before you start scraping Zoro, you need to set up your environment with the right tools and libraries. This will guide you step by step to get you started.
Tools and Libraries Required
To scrape Zoro, you will need:
Python: Due to its ease of use and robust libraries, Python is one of the best languages for web scraping.
Crawlbase Python Library: This will help you make Crawlbase Crawling API calls.
BeautifulSoup: A Python library for parsing HTML and extracting data from it.
Installing Python and Required Libraries
If you don’t have Python installed, download it from here: Python.org. Once installed, you can use pip to install the libraries. Run the following commands in your terminal:
1 2
pip install crawlbase pip install beautifulsoup4
These libraries will allow you to interact with the Crawlbase Crawling API, parse the HTML content from Zoro, and handle requests effectively.
How to Choose the Right IDE for Web Scraping
For writing your scraping script, you can use any Integrated Development Environment (IDE) or text editor. You can pick between some of the popular ones, like VS Code, PyCharm, and Jupyter Notebooks.
Scraping Zoro Search Listings
Scraping the Zoro search listings involves identifying key data points, writing a Python scraper, handling pagination, and storing the data in a structured format. Let’s break it down step by step.
Inspecting HTML to Identify Selectors
To extract the required data, inspect the HTML structure of Zoro’s search results page:
Open the Page: Visit a Zoro search results page (e.g., for “tool box”).
Inspect the Elements: Right-click on the page and select Inspect to open Developer Tools.
Locate Elements: Use the DOM explorer to find the CSS selectors for:
Brand Name: Found inside a <span> tag with the class brand-name.
Product Title: Found inside a <div> tag with the class product-title.
Price: Found inside a <div> tag with the class price.
Product URL: Found in the href attribute of an <a> tag nested within a
tag with the class product-title.
Product Image: Found in the src attribute of an <img> tag with the data attribute data-za="product-image".
Writing the Search Listings Scraper
Use the Crawlbase Crawling API to handle JavaScript rendering. Here’s the Python scraper:
return data else: print(f"Failed to fetch page {page_number}. Status: {response['headers']['pc_status']}") return []
Handling Pagination
Zoro uses the page parameter for pagination. You can loop through the pages until a set number of pages is reached or stop automatically when no more data is found on a page.
[ { "brand":"Apex Tool Group", "title":"3 Drawer Tool Box", "price":"product price: $149.99 /ea", "url":"https://www.zoro.com/apex-tool-group-3-drawer-tool-box-83151/i/G6893443/", "image_url":"https://www.zoro.com/static/cms/product/prev/Integrated Supply Network LLC_KDT83151xx1200Wx1200Hxx305c78.jpg" }, { "brand":"K-Tool International", "title":"Tool Box, 10 Drawer, Black, 41 in W", "price":"product price: $1,400.99 /ea", "url":"https://www.zoro.com/k-tool-international-tool-box-10-drawer-black-41-in-w-kti75132/i/G406006122/", "image_url":"https://www.zoro.com/static/cms/product/prev/Integrated Supply Network LLC_KTI75132xxmediaxx01xx4b250d.jpeg" }, { "brand":"Proto", "title":"General Purpose Double Latch Tool Box with Tray, Steel, Red, 20\" W x 8.5\" D x 9.5\" H", "price":"product price: $51.99 /ea", "url":"https://www.zoro.com/proto-general-purpose-double-latch-tool-box-with-tray-steel-red-20-w-x-85-d-x-95-h-j9975r/i/G0067825/", "image_url":"https://www.zoro.com/static/cms/product/prev/Z1o8_0mcpEx-.JPG" }, { "brand":"Dewalt", "title":"Rolling Tool Box, Plastic, Black, 28 in W x 12-1/2 in D x 12 in H", "price":"product price: $43.19 /ea", "url":"https://www.zoro.com/dewalt-rolling-tool-box-plastic-black-28-in-w-x-12-12-in-d-x-12-in-h-dwst28100/i/G3778857/", "image_url":"https://www.zoro.com/static/cms/product/prev/Z1wK0zqcpEx-.JPG" }, { "brand":"Milwaukee Tool", "title":"PACKOUT XL Tool Box, Impact-Resistant, Polymer, Black/Red, 22 in W x 16 in D x 19 in H", "price":"product price: $119.00 /ea", "url":"https://www.zoro.com/milwaukee-tool-packout-xl-tool-box-impact-resistant-polymer-blackred-22-in-w-x-16-in-d-x-19-in-h-48-22-8429/i/G001272021/", "image_url":"https://www.zoro.com/static/cms/product/prev/Z3pAyumcpEx_.JPG" }, .... more ]
Scraping Zoro Product Pages
Scraping product pages on Zoro allows you to extract in-depth information about individual products, such as descriptions, specifications, and reviews. Let’s break this section into actionable steps.
Understanding Product Page Structure
To scrape data effectively, use browser Developer Tools to inspect key elements and identify their unique CSS selectors.
Key elements to look for:
Product Title: <h1> tag with data-za="product-name".
Price: <div> tag with data-za="product-price".
Product Description: <div> with class product-description, nested <div> with class description-text.
Specifications: Rows in a <table> within <div class="product-details-info">, with two <td> elements per row.
Product Images: <img> tags in <div class="product-images">, with class product-image.
Extracting Key Details from Products
Below is a Python function to scrape the details of a product page:
Store the scraped product details into a JSON file for later use:
1 2 3 4 5 6
import json
defsave_product_data(data, filename='zoro_products.json'): withopen(filename, 'w') as f: json.dump(data, f, indent=4) print(f"Product data saved to {filename}")
Complete Code Example
Here’s the complete code to scrape multiple product pages and store the data in a JSON file:
defsave_product_data(data, filename='zoro_products.json'): withopen(filename, 'w') as f: json.dump(data, f, indent=4) print(f"Product data saved to {filename}")
[ { "title":"3 Drawer Tool Box", "price":"$", "description":"3 Drawer Tool Box", "specifications":{ "Item":"Tool Box", "Color":"Black", "Features":"3-Drawer", "Includes":"Three Drawers" }, "image_urls":[ "https://www.zoro.com/static/cms/product/large/Integrated Supply Network LLC_KDT83151xx1200Wx1200Hxx305c78.jpg" ], "file_path":"tt1.html" }, { "title":"Tool Box, 10 Drawer, Black, 41 in W", "price":"$", "description":"1000 lb total capacity;10 drawer w/roller bearing slides, double bay tool chest ;Anodized aluminum drawer pulls;Push bar ;Integrated UL Power Strip;10 pc EVA liner set;5\"x 2\" swivel casters, qty 2 with brake, black brackets, black wheel;Durable powder coated finish;Fully Assembled", "specifications":{ "Width":"41 in", "Item":"Tool Box", "Number of Drawers":"10", "Color":"Black", "Includes":"41\" Premium 10 Drawer Double Bay 1,000 Lb. Tool Box (Matter Black)", "Features":"Double Bay" }, "image_urls":[ "https://www.zoro.com/static/cms/product/large/Integrated Supply Network LLC_KTI75132xxmediaxx01xx4b250d.jpeg" ], "file_path":"tt2.html" }, { "title":"General Purpose Double Latch Tool Box with Tray, Steel, Red,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20\" W x 8.5\" D x 9.5\" H", "price":"$", "description":"The PROTO - J9975R is a robust tool box constructed from steel, designed to provide secure and organized storage for your tools. This individual tool box offers a generous storage capacity of 2,133 cubic inches, allowing you to accommodate a variety of tools and building materials. The toolbox features a padlockable locking system for added security against unauthorized access. It's equipped with a folding top handle that facilitates easy carrying and access.Key Features:\u2022 Constructed from durable steel material which enhances its longevity.\u2022 Offers ample storage space with an impressive capacity of 2,133 cubic inches.\u2022 Equipped with two compartments for better organization of your tools.\u2022 Features removable steel tote tray enhancing its usability and convenience.\u2022 Designed with a folding top handle for ease in carrying and accessing the toolbox.\u2022 Includes one removable tote tray offering flexibility in storage layout.", "specifications":{ "Width":"20 in", "Depth":"8-1/2 in", "Height":"9-1/2 in", "Overall Width":"20 in", "Overall Depth":"8 1/2 in", "Inside Width":"19 3/4 in", "Nominal Outside Width":"20 in", "Inside Height":"9 1/4 in", "Nominal Outside Height":"9 in", "Overall Height":"9 1/2 in", "Nominal Outside Depth":"8 in", "Inside Depth":"8 1/4 in", "Interior Dimensions":"19 3/4 in W x 8 1/4 in D x 9 1/4 in H", "Interior Depth":"8 1/4 in", "Interior Height":"9 1/4 in", "Interior Width":"19 3/4 in", "Item":"Tool Box", "Material":"Steel", "Color":"Red", "Features":"Removable Steel Tote Tray", "Includes":"Removable Tote Tray", "Handle Type":"Folding Top Handle", "Handle Design":"Folding Top", "Storage Capacity":"2,133 cu in", "Number of Pieces":"1", "Portable Tool Box Product Grouping":"Portable Tool Boxes", "Drawer Slides":"None", "Number of Drawers":"0", "Locking System":"Padlock", "Number of Trays":"1", "Weight Capacity":"40 lb", "Number of Handles":"1", "Primary Tool Box Material":"Steel", "Primary Tool Box Color":"Red", "Finish":"Powder Coated", "Number of Compartments":"2", "External Material":"Steel", "Closure Type":"Latch", "Stackable":"Not Stackable", "Body Finish":"Powder Coated", "Body Gauge":"14 ga", "Number of Keys Included":"0", "Configuration":"Individual Tool Box", "Handle Grip Style":"Metal", "Includes Keys":"Keys Not Included", "Total Load Capacity":"40 lb", "Load Capacity per Drawer":"10 lb", "Includes Drawers":"Drawers Not Included", "Number of Boxes":"1", "Includes Casters":"Casters Not Included", "Total Storage Capacity":"2,133 cu in", "Number of Dividers":"1" }, "image_urls":[ "https://www.zoro.com/static/cms/product/large/Z1o8_0mcpEx-.JPG", "https://www.zoro.com/static/cms/product/full/Z1o8_0mcpEx_.JPG" ], "file_path":"tt3.html" } ]
Final Thoughts
Scraping Zoro.com website data can be a total game changer for businesses, researchers, and developers looking to analyze product trends, compare prices, or build inventory automation tools. Using modern tools like the Crawlbase Crawling API makes handling JavaScript-rendered content and pagination a breeze.
Follow the steps in this post and you can extract data from Zoro’s search listings and product pages and save the results in a structured format like JSON. Always use this data responsibly and follow the website’s terms of service.
If you want to scrape from other e-commerce platforms check out these other guides.
Contact our support if you have any questions. Happy scraping!
Frequently Asked Questions (FAQs)
Q. Is it legal to scrape website data from Zoro?
Web scraping is generally legal if done for ethical purposes and within Zoro’s terms of service. Always check their policies and don’t scrape sensitive or restricted data.
Q. What tools do I need to scrape Zoro effectively?
To scrape Zoro, you need Python, BeautifulSoup for HTML parsing, and the Crawlbase Crawling API to handle JavaScript-rendered content and pagination.
Q. How can I store the scraped data for future use?
The scraped data can be saved in formats like JSON, CSV, or a database, depending on your project. JSON is best for structured data and is easy to integrate with other apps.