Dacă vinzi online, probabil intri din când în când pe site-ul concurenței să vezi la ce preț a pus produsul tău. Faci asta manual, poate o dată pe săptămână, și de multe ori uiți sau nu mai ai timp. Există unelte dedicate pentru monitorizare de prețuri, dar costă lunar și pentru câteva produse e cam mult. Poți face același lucru gratis, cu Google Sheets.
Ce este IMPORTXML și ce poate să facă
IMPORTXML este o funcție din Google Sheets care citește o pagină web și scoate din ea o bucată anume de text — un preț, un titlu, o disponibilitate în stoc. Îi dai adresa paginii și îi spui exact unde să caute, iar ea aduce valoarea direct într-o celulă.
Nu funcționează pe orice site. Dacă prețul apare direct în codul paginii, merge bine. Dacă site-ul încarcă prețul printr-un script, după ce pagina s-a deschis deja, IMPORTXML nu îl vede — vezi mai jos cum verifici asta.
Cum găsești locul exact unde stă prețul
Ai nevoie de ceva numit XPath — o adresă care spune unde anume, în structura paginii, se află textul pe care îl vrei. Nu trebuie să știi să scrii XPath de la zero, îl iei direct din pagină.
- Deschizi pagina produsului concurenței, în Chrome.
- Dai clic dreapta pe preț și alegi Inspect (Inspectează).
- În fereastra care se deschide, rândul cu prețul rămâne selectat. Dai clic dreapta pe el, apoi Copy (Copiază) și Copy XPath.
- Ai acum în clipboard ceva de genul
//*[@id=„price”]/span.
Formula propriu-zisă în Sheets
Într-o celulă nouă, scrii:
=IMPORTXML(„https://site-concurenta.ro/produs”, „//*[@id='price']/span”)
Observă că XPath-ul copiat din Chrome are ghilimele duble în interior — în formulă le înlocuiești cu ghilimele simple, altfel Sheets se încurcă în formulă. Dacă totul e corect, celula afișează prețul citit chiar acum de pe pagina concurenței.
Pui adresa produsului într-o coloană separată, iar formula o scrii raportat la celula aceea, ca să poți adăuga rânduri noi fără să rescrii formula de fiecare dată.
Cum vezi când s-a schimbat prețul
Pui lângă formulă o coloană cu prețul de referință — cel pe care l-ai notat tu, manual, prima dată. Apoi o a treia coloană cu formula:
=DACĂ(B2
Unde B2 e prețul citit live, iar C2 e prețul tău de referință. Când apare „A SCĂZUT” știi că trebuie să te uiți acolo. Sheets reface formulele IMPORTXML automat, de obicei la câteva ore, nu în timp real — pentru verificare mai deasă, deschizi fișierul și dai un refresh manual la pagină.
Ce nu merită să faci
Nu încerca să monitorizezi așa zeci de produse de pe un site care își schimbă structura des — la fiecare schimbare de design la concurent, XPath-ul tău se rupe și trebuie refăcut. Pentru un magazin cu sute de produse, un instrument dedicat de monitorizare chiar își are rostul. Metoda asta e bună pentru un număr mic de produse-cheie, urmărite constant, fără cost lunar.
Mâine dimineață alegi trei-patru produse ale concurenței directe, le iei XPath-ul cum ai văzut mai sus și le pui într-un Sheets nou. În o săptămână ai deja un istoric real, nu o impresie.
Întrebări frecvente
Merge IMPORTXML pe orice site de magazin online?
Nu. Dacă prețul e scris direct în codul paginii, funcționează. Dacă pagina îl încarcă ulterior printr-un script, IMPORTXML aduce o celulă goală.
De ce nu îmi arată formula nimic, deși am pus XPath-ul corect?
De obicei pentru că ai lăsat ghilimelele duble din XPath neschimbate. Trebuie înlocuite cu ghilimele simple în interiorul formulei din Sheets.
Cât de des se actualizează prețul citit în Sheets?
Automat, la câteva ore, nu în timp real. Dacă ai nevoie de o verificare chiar în momentul respectiv, deschizi fișierul și reîncarci pagina manual.
If you sell online, you probably check your competitor's site every now and then to see what they charge for the same product. You do it by hand, maybe once a week, and half the time you forget or run out of time. There are paid tools that track this for you, but for a handful of products a monthly subscription is overkill. You can do the same thing for free, with Google Sheets.
What IMPORTXML actually does
IMPORTXML is a Google Sheets function that reads a web page and pulls out one specific piece of it — a price, a title, a stock status. You give it the page address and tell it exactly where to look, and it drops that value straight into a cell.
It doesn't work on every site. If the price sits directly in the page's code, it works fine. If the site loads the price with a script after the page has already opened, IMPORTXML can't see it — here's how you check which case you're in.
Finding the exact spot where the price lives
You need something called an XPath — an address that says exactly where, in the page's structure, that text sits. You don't need to write XPath from scratch, you copy it straight out of the page.
- Open the competitor's product page in Chrome.
- Right-click on the price and choose Inspect.
- In the panel that opens, the price's line stays highlighted. Right-click it, then Copy, then Copy XPath.
- You now have something like
//*[@id=„price”]/spanin your clipboard.
The actual formula in Sheets
In a new cell, you write:
=IMPORTXML(„https://competitor-site.com/product”, „//*[@id='price']/span”)
Notice the XPath copied from Chrome has double quotes inside it — in the formula, you swap those for single quotes, otherwise Sheets gets confused about where the formula ends. If everything's right, the cell shows the price as it reads right now on the competitor's page.
Put the product address in its own column, and write the formula referencing that cell, so you can add new rows without rewriting the formula every time.
Seeing when a price has dropped
Next to the formula, add a column with your reference price — the one you noted down yourself, the first time. Then a third column with:
=IF(B2
Where B2 is the live price and C2 is your reference price. When "DROPPED" shows up, you know to go look. Sheets refreshes IMPORTXML formulas on its own, usually every few hours, not in real time — for a closer check, open the file and reload the page manually.
What's not worth doing
Don't try to track dozens of products this way on a site that redesigns often — every time the competitor changes their layout, your XPath breaks and you have to redo it. For a shop with hundreds of products, a dedicated price-tracking tool earns its keep. This method is for a handful of key products, watched steadily, without a monthly bill.
Tomorrow morning, pick three or four of your closest competitor's products, grab their XPath the way shown above, and drop them into a fresh Sheet. In a week you'll have a real history, not just a guess.
Frequently asked
Does IMPORTXML work on any online store?
No. If the price is written directly in the page's code, it works. If the page loads it afterward through a script, IMPORTXML returns an empty cell.
Why does my formula show nothing even though the XPath looks right?
Usually because the double quotes from the copied XPath were left as they are. They need to be swapped for single quotes inside the Sheets formula.
How often does the price in Sheets update?
Automatically, every few hours, not instantly. If you need a check at that exact moment, open the file and reload the page by hand.


