---
title: Finding Price Selectors
description: 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…
url: "https://pricefetchwp.com/documentation/finding-price-selectors/"
updated: "2026-09-10"
category: "Selectors & Price Detection"
---

# Finding Price Selectors

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.

1. [-What Is a price selector?](#what-is-a-price-selector)
2. [Step 1 — Open the External Product Page](#step-1-open-the-external-product-page)
3. [Step 2 — Inspect the Price Element](#step-2-inspect-the-price-element)
4. [Step 3 — Locate the Price in the HTML](#step-3-locate-the-price-in-the-html)
5. [Step 4 — Choose a Selector Type](#step-4-choose-a-selector-type)
6. [• Class Selector](#eb-table-content-5)
7. [• ID Selector](#eb-table-content-6)
8. [• XPath Selector](#eb-table-content-7)
9. [• Script Selector](#eb-table-content-8)
10. [Step 5 — Test Your Selector](#step-5-test-your-selector)
11. [⚠️Common Issues](#eb-table-content-10)
    1. [• Selector returns nothing](#eb-table-content-11)
    2. [• Wrong price is returned](#eb-table-content-12)
12. [Next Steps ───](#eb-table-content-13)

## -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-item
```

## Step 2 — Inspect the Price Element

1. Right-click on the price
2. 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](//selectorshub.com/selectorshub/) (free Chrome extension)
- [xpather.com](//xpather.com)
- AI assistant such as [ChatGPT](//chatgpt.com)

## • Script Selector

**Example:**

```
#viewed_product::Price
```

During 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](https://pricefetchwp.com/documentation/also-check/) (Fallback Selectors)**
- Learn about **[Reverse Price Logic](https://pricefetchwp.com/documentation/reverse-price-logic/)**
- Explore **[Advanced URL Entry Options](https://pricefetchwp.com/documentation/advanced-options-per-url-entry/)**
