Looking to pull product listings, prices, or reviews from ecommerce sites without banging your head against endless CAPTCHAs and blocks? This guide’s for you. I’ll walk you through how to use Zenrows to extract product data, step by step—no vague promises, no hand-waving, just what you need to actually get it working. If you’ve tried scraping ecommerce before, you know how quickly things can go sideways. Zenrows isn’t magic, but it does handle a lot of the annoying stuff for you.
Let’s get your scraper up and running.
Before You Start: What You Should Know
Before jumping in, here’s what you’re signing up for:
- Scraping ecommerce is hard: Sites like Amazon, Walmart, and others actively try to block scrapers.
- Zenrows helps, but doesn’t make you invisible: It can rotate proxies, bypass CAPTCHAs, and render JavaScript—but it’s not a cloak of invisibility.
- Don’t scrape logged-in or paywalled content: That’s asking for legal headaches.
- Check the site’s robots.txt and terms: Most sites don’t love scraping, but some are stricter than others. You’ve been warned.
If you’re okay with all that, let’s get to it.
Step 1: Sign Up for Zenrows and Get Your API Key
You’ll need a Zenrows account. The free tier is enough for small projects or testing.
- Go to the Zenrows website and sign up.
- Once logged in, head to your dashboard.
- Find your API key—it should be front and center.
Pro Tip:
Don’t share your API key with anyone. Treat it like a password.
Step 2: Pick Your Target (And Inspect the Data)
Choose the ecommerce website you want to scrape. Let’s use a real-world example: scraping product data from an Amazon category page.
- Go to the product listing page you want to scrape.
- Right-click and choose “Inspect” (or hit
Ctrl+Shift+I
) to open Developer Tools. - Hover over product titles, prices, and images to see the HTML structure.
What matters:
- Are products listed in <div>
s, <li>
s, or some weird custom tag?
- Are prices inside a class like .a-price-whole
or something else?
- Is there lazy-loaded content (stuff that loads as you scroll)?
Ignore:
- Ads, sponsored spots, or “recommended” carousels unless you want them.
Heads-up:
Amazon and some others use ever-changing class names or embed data in JavaScript. If you see random gibberish class names, be ready to adapt your selectors often.
Step 3: Make Your First Zenrows API Request
Zenrows is basically a smart proxy. You send a request to their API with your target URL, and it handles the hard parts (rotating IPs, solving CAPTCHAs, rendering JavaScript if needed). You get back the HTML.
You can use curl, Postman, Python, Node.js—whatever you like. Here’s a simple Python example using requests
:
python import requests
api_key = "YOUR_API_KEY" target_url = "https://www.amazon.com/s?k=wireless+headphones"
zenrows_url = f"https://api.zenrows.com/v1/?apikey={api_key}&url={target_url}&js_render=true"
response = requests.get(zenrows_url) html = response.text
print(html[:1000]) # Print a snippet to verify you got the real page
Notes:
- js_render=true
tells Zenrows to render JavaScript. Turn it off for faster, simpler sites.
- If you get a CAPTCHA page or an error, try toggling options like premium_proxy=true
or antibot=true
. But remember—these cost more API credits.
What works:
- Zenrows handles most Amazon category pages pretty well.
- It’s great for sites that block regular requests or use heavy JavaScript.
What doesn’t:
- Some sites change their structure or block scrapers aggressively. Expect to tweak your approach.
- Don’t expect to download thousands of pages in minutes. Pace matters.
Step 4: Parse the Product Data from the HTML
Now that you have the HTML, you’ll need to pull out the data you want. Use a library like BeautifulSoup (Python) or Cheerio (Node.js).
Here’s a Python example with BeautifulSoup:
python from bs4 import BeautifulSoup
soup = BeautifulSoup(html, "html.parser") products = []
for item in soup.select(".s-result-item"): title = item.select_one("h2 a span") price = item.select_one(".a-price-whole") image = item.select_one("img")
if title and price and image:
products.append({
"title": title.text.strip(),
"price": price.text.strip(),
"image": image["src"]
})
print(products)
Tips:
- Use your browser’s dev tools to get the right selectors—don’t trust selectors from tutorials; sites change them all the time.
- Sometimes, product data is buried in JSON inside <script>
tags. If the HTML is a mess, search the page for application/ld+json
or similar.
What to ignore:
- Don’t try to pull every possible field on your first go. Grab the basics, see what you get, then iterate.
Step 5: Handle Pagination
One page is never enough. To get more products, you’ll need to follow “next page” links.
- Find the “next” button in the HTML and get its URL.
- Repeat the Zenrows request for each page.
Example:
python next_page = soup.select_one("a.s-pagination-next") if next_page: next_url = "https://www.amazon.com" + next_page["href"] # Repeat the process for next_url
Caveats: - Some sites use AJAX for pagination—meaning the next set of products loads without a full page refresh. You may need to mimic those AJAX requests or scroll with Zenrows’ JavaScript rendering. - Don’t hammer the API with dozens of parallel requests; you’ll get blocked or hit your credit limit fast.
Step 6: Clean and Save Your Data
Raw scraped data is messy. Here’s what to do:
- Remove duplicates
- Strip whitespace and weird characters
- Convert prices to numbers (watch for currency symbols)
- Save to CSV or JSON for easier analysis down the line
Python example:
python import csv
with open("products.csv", "w", newline="", encoding="utf-8") as f: writer = csv.DictWriter(f, fieldnames=["title", "price", "image"]) writer.writeheader() writer.writerows(products)
Don’t overthink it:
You’re not building a production database—get the basics working, then refine.
Step 7: Troubleshooting and Staying Under the Radar
Scraping ecommerce is a moving target. Here’s what you’ll run into:
- CAPTCHAs: Zenrows solves some, but not all. If you keep getting blocked, try fewer requests, longer delays, or premium proxies.
- Changing HTML: Your selectors will break. Bookmark the site, check your script every week or so.
- Data missing: Some data (like ratings or reviews) may be loaded separately or only appear after scrolling. Play with
js_render
and inspect network requests in your browser. - Legal pushback: Don’t scrape sites that explicitly forbid it (or do so at your own risk).
What’s not worth your time:
- Building a hyper-complex scraper for one-off jobs. Keep it simple.
- Trying to outsmart every anti-bot system. Sometimes it’s easier to buy the data or look for an API.
Final Thoughts: Keep It Simple, Start Small
Scraping product data with Zenrows isn’t rocket science, but it’s not “set and forget” either. Start with one page, get the basics working, and don’t panic when things break—they will. Iterate, adjust your selectors, and above all, don’t try to scrape half the internet in one night.
If you hit a wall, step back and rethink. Sometimes the best tool is the one that lets you get back to more interesting work faster.
Happy scraping.