To fetch prices correctly, PriceFetchWP needs to know where the price exists on the external page.
This is done by using price selectors (XPath, ID, Class, Script).
This guide will show you how to find and use selectors, even if you have no technical experience.
-What Is a price selector?
A price selector tells PriceFetchWP:
“This is where the price is located on the pages.”
Every website has a different structure, so you must identify the correct element that contains the price.
Step 1 — Open the External Product Page
Go to the product page where you want to pull the price from.
Example:
https://example-store.com/product-itemStep 2 — Inspect the Price Element
- Right-click on the price
- Click Inspect (or “Inspect Element”)
This opens your browser’s developer tools.
Step 3 — Locate the Price in the HTML
When the inspector opens:
- The price will be highlighted in the HTML panel
- Look for elements like:
<span class="price">$19.99</span>or
<div id="product-price">Price $19.99</div>PriceFetchWP will automatically extract the number only. In the examples above, it would only pull in “19.99”.
Step 4 — Choose a Selector Type
PriceFetchWP supports three selector types for targeting HTML elements. Note: Be sure to tell PriceFetchWP which element you are using.
• Class Selector
Example:
.price• ID Selector
Example:
#product-price• XPath Selector
Example:
//*[@class="price"]XPath can be a bit harder to work with. Some tools that can help:
- SelectorsHub (free Chrome extension)
- xpather.com
- AI assistant such as ChatGPT
• Script Selector
Example:
#viewed_product::PriceDuring some tests, it was discovered that some websites would add in pricing through a script.
Step 5 — Test Your Selector
After adding your selector in PriceFetch:
- Save your entry
- Use the test entry tool to test a price fetch
- Confirm the correct price appears
If the price doesn’t show, try targeting a different HTML element or using a different selector type. Having issues? Check our troubleshooting page.
⚠️Common Issues
• Selector returns nothing
- The selector itself could be incorrect
- Incorrect element selected (Example: Targeting Class but have XPath selected)
- External site possibly blocking request
• Wrong price is returned
- Selector is targeting the wrong element
- Multiple elements on the page match same selector
The two most common reasons a price can’t be fetched: Request was blocked, and external site is using dynamic HTML elements. Check our troubleshooting page.
Next Steps ───
Now that you know how to find selectors:
- Continue to Secondary Checks (Fallback Selectors)
- Learn about Reverse Price Logic
- Explore Advanced URL Entry Options