What this thread does
The problem
Every week you open several shop pages, copy prices into a Google Sheet, and typos slip into the numbers your report uses. The sites have no API.
What the thread says (r/googlesheets, 14 September 2026)
The post by Inner_Two_3627 asks exactly this (checked 2026-11-15). The replies that were repeated by several commenters:
1. Check the page source first. Open the product page, view source, and search for the price. If it is there, IMPORTXML with a short XPath can work, or IMPORTHTML if the price sits in an HTML table or list. Google's import-function guide says these functions check for updates every hour while the document is open; for a scheduled weekly run, use a script with a time trigger. If it is not, the page loads it with a script and IMPORTXML will not see it. 2. Use the request the page makes. Open the browser network tab, reload, filter to XHR, find the response carrying the price. It is often clean JSON. Call that URL from Apps Script (UrlFetchApp) on a weekly time trigger. Two commenters gave this advice independently, one adding that mid-sized shops nearly always have such an endpoint. 3. Look for JSON-LD. If the price is in the source, it is often in a structured data block that parses more reliably than an XPath into the page layout. 4. Log raw runs. Write each run to a log tab with the date and the raw value, so a changed site shows as a blank in the log, not as a wrong price in the report. 5. Sanity checks before the report. One commenter: if you normally get 200 products and suddenly get 37, fail the run. Do the same for blank prices or many zeros. A scraper that breaks loudly is easy; bad data that looks valid is the problem. 6. Manual fallback. Copy the whole area from the page and let formulas parse it, or save the page, if you do not code.
Some sites deter scraping; check each site's terms before you automate.
Where an agent helps (my suggestion, not tried)
An agent can look at one saved page and the network request, write the Apps Script function, and add the log tab and checks. Give it a page you saved yourself and the exact fields you need; do not give it your Google credentials or ask it to run against sites you have not checked.
Prompt: "Here is a saved HTML file and the JSON response I copied from the network tab. Write an Apps Script function that appends date, product id and price to a Log sheet, fails if fewer than 90% of last week's product ids are present, and flags blank or zero prices."
Limits
Forum advice from commenters; one commenter in the thread was promoting a service and I ignored that. I did not build or run it.
Sources
- IMPORTXML and IMPORTHTML (Google Docs Editors Help), read. Checked:
IMPORTXML(url, xpath_query, locale)imports from structured sources including XML, HTML, CSV, TSV and RSS/Atom;IMPORTHTML(url, query, index)imports only a table or a list from an HTML page. These two function-reference pages do not mention JavaScript-rendered content; the import-function guide documents hourly checks while the document is open. - UrlFetchApp (Google Apps Script reference), read. Checked: Apps Script can send HTTP and HTTPS requests with
fetch(url)(needs thescript.external_requestscope). - Installable triggers (Google Apps Script guide), read. Checked: time-driven triggers can run weekly (the page's example runs on a weekday at an hour); the exact time may be slightly randomized, so a Monday 9 AM trigger can fire between 9 and 10; a failed run emails the trigger's creator.
- Product structured data (Google Search Central), read. Checked: Google's examples show product
offersandpricein JSON-LD, RDFa and Microdata, with no stated preference. That a JSON-LD block parses more reliably than an XPath is a commenter's opinion and not in the page. - Corrections made:
IMPORTHTMLonly reads tables and lists; Google's import-function guide documents hourly checks while the document is open, and a weekly time trigger schedules a script, so the original "can work and refresh weekly" was narrowed.
Checked on 2026-11-15: the r/googlesheets thread, its date, author and commenters' advice, including the script-loaded-price and mid-sized-shop remarks. Those remarks remain forum claims and were not independently tested here. Not checked: any shop's terms of use and the 90 percent prompt. I did not build or run the script.
Started from a post by @Inner_Two_3627, packaged by the editor. Original post