# HELP: Facebook Marketplace ever-changing CSS class names

**URL:** <https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683>\
**Category:** Help and Support\
**Tags:** facebook, social-media\
**Created:** [February 27, 2023, 12:59am UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683 "2023-02-27T00:59:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![612mc](https://forums.distill.io/letter_avatar_proxy/v4/letter/6/b487fb/32.png) [@612mc](https://forums.distill.io/u/612mc)\
**Post date:** [February 27, 2023, 12:59am UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/1 "2023-02-27T00:59:00Z")

</div>

I am curious if you know of a way to monitor Facebook Marketplace? Right now, they have garbage names in their CSS classes like ‘xzvvcxz’ that change out every hour, so the Distill monitor fails since the CSS value changed. But, they do have a fixed aria-label=“Collection of Marketplace items” that perhaps I could latch onto for checking?

So the question is - is there any way to check this unique aria-label tag in a distill query?

Here it is in the code:

aria-label=“Collection of Marketplace items”

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [February 27, 2023, 6:13pm UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/2 "2023-02-27T18:13:28Z")

</div>

Hi @612mc, welcome to the community forum. Selecting the elements that have the `aria-label="Collection of Marketplace items"` attribute should be possible using the following CSS selector:

`[aria-label="Collection of Marketplace items"]`

Notice that I have changed the double quotes character. Can you try it out and see if it works? Make sure to use the CSS selector type when using this selector.

Cheers!

---

<div class="post-metadata">

**Author:** ![612mc](https://forums.distill.io/letter_avatar_proxy/v4/letter/6/b487fb/32.png) [@612mc](https://forums.distill.io/u/612mc)\
**Post date:** [February 27, 2023, 11:04pm UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/3 "2023-02-27T23:04:57Z")

</div>

I think it might have worked! No errors yet. Here is my config, looking good?

```json
{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "css",
              "expr": "[aria-label=\"Collection of Marketplace items\"]",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                },
                {
                  "type": "attribute",
                  "name": "aria-label"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text"
}

```

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [February 28, 2023, 1:53am UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/4 "2023-02-28T01:53:50Z")

</div>

Yes, looks good! I edited the post to make it appear as code as shown below:

````auto
```
{code}
```

````

---

<div class="post-metadata">

**Author:** ![tinsley2662](https://forums.distill.io/letter_avatar_proxy/v4/letter/t/65b543/32.png) [@tinsley2662](https://forums.distill.io/u/tinsley2662)\
**Post date:** [August 27, 2024, 4:27pm UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/7 "2024-08-27T16:27:11Z")

</div>

could I make this work to just monitor vehicles for sale? curious if it is still working for you?

---

<div class="post-metadata">

**Author:** ![koltrast](https://forums.distill.io/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@koltrast](https://forums.distill.io/u/koltrast)\
**Post date:** [November 10, 2024, 12:19am UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/8 "2024-11-10T00:19:54Z")

</div>

I think I found a better way, building on your idea. What I use is the following xpath:

```auto
(//div[@aria-label="Collection of Marketplace items"]//span[@aria-hidden="true"])[position()<=8]

```

This checks the title and location of the first 4 results on the Marketplace search page. Remove `[position()<=8]` for checking every result loaded without scrolling. Change `8` to `2` to only check the first result.

Be aware that the URL doesn’t contain the search location and radius info, so if you change those when you manually search, your Distill monitors might trigger, since they’ll also use the modified location. If the location and radius is stored client-side, than a separate container in Firefox or using the desktop app might solve this issue, but I’m not sure, since manually resetting them to a single value for all my searches is sufficient for me.

---

<div class="post-metadata">

**Author:** ![amery15](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@amery15](https://forums.distill.io/u/amery15)\
**Post date:** [January 11, 2025, 6:54am UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/9 "2025-01-11T06:54:19Z")

</div>

Is there a way to modify the xpath to include the images of the marketplace listings that are detected? Thank you 🙂

---

<div class="post-metadata">

**Author:** ![raksha](https://forums.distill.io/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@raksha](https://forums.distill.io/u/raksha)\
**Post date:** [January 16, 2025, 6:03am UTC](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/10 "2025-01-16T06:03:38Z")

</div>

@amery15 To include images and show in the change history, you can add one more Xpath expression

`(//div[@aria-label=\"Collection of Marketplace items\"]//img)`

To monitor the title and location of the listed items for top 4 results, you can update your expression as suggested in [HELP: Facebook Marketplace ever-changing CSS class names - #8 by koltrast](https://forums.distill.io/t/help-facebook-marketplace-ever-changing-css-class-names/1683/8)

Here is the final config if you would like to monitor the title and location of the top four items. The config also includes the expression to show images in change history.

```auto
{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "xpath",
              "expr": "(//div[@aria-label=\"Collection of Marketplace items\"]//img)[position()<=4]",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            },
            {
              "type": "xpath",
              "expr": "(//div[@aria-label=\"Collection of Marketplace items\"]//span[@aria-hidden=\"true\"])[position()<=10]",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text",
  "regexp": {
    "expr": "",
    "flags": "gim"
  }
}

```
