Prompt
How do I extract product prices from a website into a spreadsheet?
Latest observation
There are a few common ways to extract product prices from a website into a spreadsheet, depending on how the site is built and how many products you need.
1) Manual copy/paste
Best if you only have a few items.
- Open the product page
- Copy the price
- Paste into Excel or Google Sheets
- Repeat for each product
This is simple but slow.
2) Use a spreadsheet import tool
If the website allows it, you can pull data directly into a spreadsheet.
In Google Sheets
You can use:
IMPORTHTMLfor tables/listsIMPORTXMLfor page elements
Example:
=IMPORTXML("https://example.com/product-page", "//span[@class='price']")
This can work well, but many modern websites block it or load prices with JavaScript, which Sheets can’t always read.
3) Use a web scraping tool or browser extension
Good for collecting many product prices.
Popular options:
- Web scraper extensions for Chrome/Edge
- Octoparse
- ParseHub
- Apify
- Instant Data Scraper
Typical workflow:
- Open the website
- Select the price element
- Let the tool extract prices from the product list
- Export as CSV or Excel
- Open in your spreadsheet
4) Use Python for more control
If you’re comfortable with code, Python is powerful.
Common libraries:
requestsBeautifulSouppandasseleniumfor sites that use JavaScript
Example for a simple static page:
import requests
from bs4 import BeautifulSoup
import pandas as pd
url = "https://example.com/products"
html = requests.get(url).text
soup = BeautifulSoup(html, "html.parser")
prices = [p.get_text(strip=True) for p in soup.select(".price")]
df = pd.DataFrame({"price": prices})
df.to_excel("prices.xlsx", index=False)
5) Use the site’s API if available
This is usually the cleanest method.
Many sites have product data in an API response behind the scenes. If you can access that:
- It’s more reliable than scraping HTML
- Easier to automate
- Often includes prices in structured form
You can then export the API results to CSV/Excel.
Important notes
- Check the website’s terms of service and robots.txt
- Some websites block scraping or require login
- Prices may change often, so automation may need to run regularly
- Some sites show different prices by location, currency, or user type
Best approach by situation
- Few products: manual copy/paste
- Simple static site: Google Sheets
IMPORTXMLor Python + BeautifulSoup - Large catalog: scraping tool or Python
- JavaScript-heavy site: Selenium, Playwright, or a scraping platform
- Best long-term: official API if available
If you want, I can show you:
- how to do it in Google Sheets,
- how to do it in Excel, or
- a Python script for a specific website.