Import Website Data into Excel: Stop Copying Supplier Prices and Stock by Hand
CONTENTS10 sections
If a supplier publishes prices and stock in a plain HTML table, Excel’s Data > From Web command (Power Query) can pull that table and, if refresh on open is ticked, refresh it each time the workbook opens; no other software is needed. If the page needs a login, or prices are loaded later by JavaScript, that route becomes unreliable, and asking the supplier for a CSV, XML file or API is sturdier. The real work is usually matching rather than pulling: mapping the supplier’s code to your stock code, a pack price to a unit price, a foreign-currency price to your own, and keeping each changed price with its date.
I re-read the Microsoft sources on 31 October 2026.
Which route fits when?
The source’s format decides the route; three suppliers can need three routes.
| Route | When it fits | Limit |
|---|---|---|
| Power Query From Web, detected table | Prices sit in an HTML table, no login | Breaks when the page layout changes; refreshes while Excel is open (inference) |
| Add table using examples | Data is a regular list with no table | Results need spot checks; rebuild when the layout changes |
| Supplier’s CSV, XML or Excel file | The supplier publishes a file at a fixed address | Supplier sets the update frequency |
| API | The supplier issues a key | The key must be stored safely and format changes watched |
| Price list sent by email | The dealer portal needs a login | Supplier sets the frequency; someone files it |
Power Query From Web, step by step
Pulling a page with a table takes five steps; check the result before loading it.
- Choose Data > From Web and enter the address. Pick an authentication type on first connection (Anonymous for a public page) and select the detected table in Navigator (Microsoft: Web connector, steps in Excel).
- If no table is found, use Add table using examples and type a few product names and prices; Power Query collects values that fit the same pattern (Microsoft: web data by example).
- Choose Transform instead of Load. Remove unwanted columns and strip currency text. Right-click the price column header, choose Change type > Using locale, then pick Decimal Number and the source’s locale (Microsoft: Power Query data types). “4,50” read with a decimal-point locale becomes 450.
- In each supplier’s query, use Add column > Custom column to add a fixed Supplier value (“A”, “B”, “C”), and keep the column names identical across queries: Supplier, SupCode, Price, Stock. Then Home > Append queries as new with Three or more tables stacks them. Microsoft says the append matches columns by name and fills a missing column with nulls (Microsoft: append queries). Load it as
tblFetch; matching happens in sheet formulas below. - Set refresh: the query properties offer Refresh every n minutes and Refresh data when opening the file (Microsoft: refresh an external data connection). Microsoft does not say what happens with the file closed; Excel runs the timer, so my reading is that both work only while the workbook is open.
What breaks when the page changes?
Three things often change:
- Column name. When the “Price” header becomes “List price”, the step that refers to that column by name fails and refresh stops.
- Table position. Microsoft’s sample code selects the table by position,
Source{0}[Data](Microsoft: Web connector troubleshooting). If a new table appears above it, the query can read a different table without raising an error. Check in Advanced Editor how your query selects its table. - Pagination. If products move to a second page, the query likely returns only the first page, without an error; test it.
Both still look successful; the row count check below catches them.
Pages that need a login
A sign-in page on a dealer portal is not the connector’s Basic authentication; my inference is that such logins generally fail. If it fails, ask the supplier for a file. I do not build imports that bypass access controls or use accounts without authorisation.
Prices loaded later by JavaScript
On dynamic pages, where the price appears seconds after loading, Microsoft describes intermittent “column not found” errors and suggests the WaitFor option of Web.BrowserContents; per the same page, Excel’s From Web step generates the older Web.Page function. I have not tested WaitFor in Excel.
Developer tools may show the price coming from a separate JSON address; that is no supplier API, can change without notice and falls under the site’s terms. Ask first.
If the source has a file or an API, use it
A supplier’s file at a fixed address is sturdier than an HTML page, which breaks whenever its design changes. The Web connector also reads CSV, Excel, JSON, XML and PDF files on the web (Microsoft); enter the file address in the same From Web command.
Ask the supplier for:
- Supplier product code and description
- Sales unit and pack quantity (piece, metre, pack of 100)
- List price and your own price in separate columns
- Currency, and whether tax is included
- Stock as a number or as “in stock / out of stock”
- Price validity or last update date
- Fixed file address and column names, with notice of changes
Connecting an XML feed to your stock or ecommerce system goes beyond Excel; see the supplier XML product feed integration page.
Legal and ethical limits: terms, robots.txt, personal data
Before pulling a page into Excel, I check four things. This is not legal advice; ask your lawyer about contracts and terms.
Terms of use. Terms can restrict automated access, copying or commercial use. On a dealer portal your dealer agreement also applies and may require negotiated prices to stay confidential.
robots.txt. This file tells crawlers which addresses they may access; the standard itself states that these rules are not a form of access authorisation (RFC 9309, section 1). So an allowed address does not mean the terms allow your use; a disallowed one is the site’s request, and I respect it.
Personal data. Under the GDPR, which covers personal data of people in the EU, personal data is any information relating to an identified or identifiable natural person (GDPR Article 4(1)). Product prices and stock are generally not personal data. If a page lists a sales representative’s name and phone or reviewers’ names, do not import those columns. In Turkey, Law No. 6698 (KVKK) Article 3(1)(d) gives the same definition.
Ask the supplier. Before reading a supplier’s site, email them: “We’d like to pull your price page into Excel daily; is that fine, or can you send a file?” The question opens both permission and the file request in one exchange; the reply is no substitute for legal advice.
Example: three suppliers, 180 items, 11 missed price changes
Company, suppliers and figures are fictional; I checked every number with a Python script.
The purchasing team of a hydraulic cylinder manufacturer tracks prices for 180 items on three supplier sites: 90 fittings and hoses from A, 60 seals and O-rings from B, 30 bearings from C. Supplier C quotes in a foreign currency. Each period is 20 working days.
| Period | Price changes | Seen | Missed |
|---|---|---|---|
| Previous: weekly copying by hand | 26 | 15 | 11 |
| Next: Power Query, mapping table, history | 24 | 22 | 2 |
Previous period: copying by hand once a week
The buyer copied prices into an Excel list at the start of each week. At the end of the period, all 180 items were reviewed while building a mapping table; 17 (9.4%) had a problem:
| Problem | Rows | What it broke |
|---|---|---|
| Supplier code changed or product withdrawn | 7 | The same old price had sat in the list for months |
| Unit mismatch (B’s pack of 100, A’s 50-metre reel) | 6 | A pack price had been entered as a unit price |
| Similar name, different size (R-1210 instead of R-1208) | 4 | Another product’s price landed in this row |
The unit mismatch was the hardest to spot: B’s O-ring pack costs 450, one piece 4.50. The list showed 450 per piece, a hundred times too high.
The suppliers’ price history for the period showed 26 changes. The weekly list picked up 15 correctly; of the 11 missed, 6 were in the problem rows, 4 were two promotions that dropped and returned within one week, and 1 was the first of two increases on one item in the same week.
Next period: Power Query, a mapping table and a history sheet
The 17 rows were fixed. Only 90 of the 180 items, A’s, could be pulled from an HTML page; files were requested for B and C. B’s prices loaded through JavaScript, so B supplied a daily CSV. C’s portal needed a login; C agreed to email a weekly Excel list. A and B refreshed each morning when the workbook opened.
Of the period’s 24 changes, 13 were at A, 8 at B, 3 at C. The 2 missed changes were the start and end of a single C promotion: the price dropped mid-week and returned the same week, so the weekly list saw neither. Three more things happened:
- Working day 9: B’s CSV arrived half complete: 610 rows instead of the usual 1,240. Refresh succeeded with 31 of the 60 B items missing; the row count check caught it that morning.
- Working day 13: A renamed its “Price” header, the refresh failed and the step was fixed the same morning. Two A items also changed code; both showed “NO MATCH” and were mapped that day.
- Working day 17: the buyer was on leave and nobody opened the workbook. Two changes from day 16 were seen a day late.
Supplier files and the 17-row cleanup helped as much as Power Query. The last item is this setup’s real limit: refresh depends on one person.
Matching: supplier code, unit, currency and dated prices
One mapping table carries the matching: one row per supplier code, with your stock code, a unit factor and a currency code.
tblMap: Key, Supplier, SupCode, StockCode, Factor, CurrencyCode. The Key column is=[@Supplier]&"|"&[@SupCode]. Factor is how many of your units the supplier’s price covers: 100 for a pack of 100, 50 for a 50-metre reel.tblRate: CurrencyCode, Rate. Your own currency is 1; enter the foreign rate your company uses that day.tblFetch: the appended query’s columns plus the formula columns you add.tblHistory: Date, Key, StockCode, UnitPrice.
Filling the mapping table the first time means entering supplier code, stock code, factor and currency by hand for all 180 rows; it is done once and is the real setup effort.
Formulas for tblFetch, one job per column so an error points to its cause:
Key: =[@Supplier]&"|"&[@SupCode]
StockCode: =XLOOKUP([@Key],tblMap[Key],tblMap[StockCode],"NO MATCH")
Factor: =XLOOKUP([@Key],tblMap[Key],tblMap[Factor],"")
CurrencyCode: =XLOOKUP([@Key],tblMap[Key],tblMap[CurrencyCode],"")
Rate: =XLOOKUP([@CurrencyCode],tblRate[CurrencyCode],tblRate[Rate],"")
UnitPrice: =IF([@StockCode]="NO MATCH","",[@Price]/[@Factor]*[@Rate])
LastSaved: =XLOOKUP([@Key],tblHistory[Key],tblHistory[UnitPrice],"",0,-1)
Status: =IF([@StockCode]="NO MATCH","NO MATCH",IF([@LastSaved]="","NEW",IF(ROUND([@UnitPrice],2)<>ROUND([@LastSaved],2),"CHANGED","")))
The key combines supplier and code because two suppliers can share a code. Without your own currency’s row in tblRate, UnitPrice errors. The -1 in LastSaved searches the history from the last row upwards (Microsoft: XLOOKUP); XLOOKUP is not available in Excel 2016 and 2019. You can also match in Power Query with Merge queries and a left outer join; I use formulas because the history comparison stays on the sheet anyway.
The example rows come out like this (the foreign rate of 40 is an example value):
| Supplier code | Price pulled | Unit price | Status |
|---|---|---|---|
| A · R-1208 | 86.40 | 86.40 | |
| A · H-12-50M (50 m reel) | 2,150.00 | 43.00 | CHANGED (was 41.50) |
| B · OR-2030-P100 (pack of 100) | 450.00 | 4.50 | |
| C · 6204-2RS (foreign currency) | 3.20 | 128.00 | CHANGED (was 124.00) |
| A · R-1210N (new code) | 91.00 | NO MATCH |
Keeping prices with their dates. Power Query does not keep earlier refreshes; you write the history yourself. On day one every row is “NEW” and you paste them all. After that, each morning, filter rows with Status “CHANGED” or “NEW”, check them and paste them as values into tblHistory with the date. Changed rows are enough, because LastSaved finds the latest entry. A skipped day leaves a gap.
Stock: turning text into numbers
Stock may not arrive as a number. In the query, first add a column flagging rows containing ”+” as “at least”, then use Replace values to turn “Out of stock” into 0 and remove the ”+” (Microsoft: replace values). An empty stock cell is unknown stock; do not count it as zero, flag it separately, and never fill a missing value silently with the previous one. To track stock like price, add a Stock column to tblHistory, repeat the LastSaved and Status formulas for stock, and give items that drop to zero a “STOCK 0” status: right after the NO MATCH check, Status gets IF(AND(ISNUMBER([@Stock]),[@Stock]=0),"STOCK 0",…); ISNUMBER stops an empty cell counting as zero.
I have not run these formulas in Excel; I tested their logic on the example data with a Python script. With a comma decimal separator, use ; between arguments.
Monitoring refresh: last pull, row count, alerts
I monitor three things separately for each source.
- Time of the last successful pull. Produce the timestamp inside the data query; a separate clock query succeeds even when the data query fails. Older than today means no refresh; day 13 in the example.
- Row count. Compare the rows coming from the source with an expected band. In the example B’s file normally had 1,240 rows; with a band of 70–130% of last month’s average (868–1,612, my suggested starting point), 610 rows fell outside it. Also count how many tracked items were found.
- An alert when the source changes. While the workbook is open, a check cell with conditional formatting is enough. I also add a check for web sources: if more than 30% of prices show “CHANGED” in one day, suspect the import first (my suggested starting point).
=COUNTIF(tblFetch[Status],"CHANGED")/ROWS(tblFetch[Status])gives that share. Mixed-up decimal separators move every price a hundredfold at once.
Check queries, error tables and email alerts: see the Power Query refresh monitoring page.
Where does a web app start?
When refresh depends on one person, history is pasted by hand and price decisions rest on one pair of eyes, Excel falls short. I ask four questions:
- Are there more than three sources, or different formats?
- Must the pull run every day without anyone opening the file? Day 17 in the example.
- Does a price update need approval? The buyer proposes, a manager approves, and only then does the price reach the quote list or ERP. In Excel everyone changes the same cell with the same rights.
- Is the history needed as evidence? In a price dispute with a supplier, a hand-pasted sheet is weak evidence.
If two or more answers are yes, consider an application seriously. If only one is yes, tighten Excel first: mapping table, row count check, daily history. If none is, I would not recommend commissioning an app. For a few rows once, a setup is not worth paying for.
In such an application, scheduled pulls, a pull log, an owned “NO MATCH” queue, approval, dated price and stock history and an audit trail can be built as needed, and the scope is set in writing at the first step. The first version focuses on what Excel cannot provide: an unattended morning pull, approval and the audit trail. It starts with A’s pull and the “NO MATCH” queue; B’s CSV and C’s emailed list follow as file uploads.
It runs on a server that can be opened in your company’s name; the data is yours, exportable to Excel or CSV any time. A small or mid-sized team pays no per-user licence, only server and maintenance. The source code sits in your repository with run instructions, dependencies and known limitations.
Competitor selling prices are a separate job; see competitor price tracking.
Frequently Asked Questions
Does this work on a Mac or in Excel for the web?
Microsoft’s table of Power Query data sources lists the Web source for Windows versions; the Mac table has no Web row, and the web version lists only “Web API” (Microsoft: Power Query data sources in Excel versions). Mac users: build and refresh the query on Windows.
Is it worth having an AI tool read the page and extract prices?
It can help with reading when the layout changes often; matching and freshness are still yours to check. Do not upload negotiated portal prices to an outside tool unless your supplier agreement allows it.
How is the same job done in Google Sheets?
In Sheets, the IMPORTHTML function pulls a table or list from a page; I have not tested how it behaves on JavaScript-loaded pages. The mapping table and history logic stay the same, and XLOOKUP exists in Sheets too.
Start with your sources
Tell me which route each supplier needs: send the links to the source sites and a sample of the target workbook with personal data removed via the contact page or WhatsApp on +90 549 654 64 89.
How do I work?
Work-hour packages
Tell me about your business and what you need on WhatsApp or by phone; we agree on a work block of somewhere between 5 and 40 hours and I start doing what is needed. What you get is not a calendar window: it is net working hours spent directly on your business. I can use 40 hours working three days straight, or deliberately spread it out and finish it over a year: whatever the work calls for. I do not spend my time estimating how long something will take, I spend it doing the work; every hour I spend leaves a lasting result in your business. We keep going for as long as you find it useful.
Why not monthly?
Does a 40-hour block mean one week?
On a fixed monthly fee both sides are watching the wrong thing: you watch a fixed cost, the other side watches how many more contracts like this they can line up. Working by the hour puts us both in front of the same thing: the real value of the work that got done. I know not having an upfront answer to "how much will this cost in total?" is the natural cost of this model. But instead of paying a fixed fee for months to a setup that is not producing results, you only pay for the qualified time spent on your work: and you see exactly where that time went, start to finish. That is why my clients keep coming back.
