# Monitoring dynamically generated elements

**URL:** <https://forums.distill.io/t/monitoring-dynamically-generated-elements/2633>\
**Category:** Help and Support\
**Tags:** selectors\
**Created:** [October 25, 2023, 11:32pm UTC](https://forums.distill.io/t/monitoring-dynamically-generated-elements/2633 "2023-10-25T23:32:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuckster](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Stuckster](https://forums.distill.io/u/Stuckster)\
**Post date:** [October 25, 2023, 11:32pm UTC](https://forums.distill.io/t/monitoring-dynamically-generated-elements/2633/1 "2023-10-25T23:32:03Z")

</div>

Hi.

I have looked at all of the support posts involving dynamic content etc, but could not find a specific solution to what I think must be a common issue.

Pages that I monitor contain dynamic Xpath elements that change daily. Every day the monitors break because they can no longer find the previous day’s element. What is the best way around this please?

Example  
[https://www.bunnings.com.au/fiskars-x25-xl-splitting-axe\_p3360996](https://www.bunnings.com.au/fiskars-x25-xl-splitting-axe_p3360996)

The Xpath element to monitor the price of this item looks something like this

```auto
//main[@id='main']/div[contains(@class,'jINGaM')]/div[@class='container-main']//div[contains(@class,'dmAWSL')]/div//div[@class='container']/div[contains(@class,'MuiGrid-root')]/div[contains(@class,'productDetails')]/div[contains(@class,'doa-dFD')]/div[contains(@class,'MuiGrid-root')]/div[contains(@class,'MuiGrid-root')]/div[contains(@class,'dhNsnU')]/div[contains(@class,'dVChWy')]//p[contains(@class,'dwOrgK')]

```

As you can see, many of the @class elements contain dynamically generated random codes

Eg:

```auto
(@class,' ******')

```

Am I best to target the parent class, use wildcards, or would Ihave more luck using a CSS or Javascript selector?

Many thanks for you help!

---

<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:** [October 26, 2023, 6:49am UTC](https://forums.distill.io/t/monitoring-dynamically-generated-elements/2633/2 "2023-10-26T06:49:14Z")

</div>

Hello Andrew, I think you have identified the problem correctly. The autogenerated XPath expressions contain parts that seems to change quite frequently. This makes the selectors unstable.

We recently updated the Chrome and Edge extensions (3.6.17+) to create much better selectors. It does that by trying to remove to unstable looking parts from the selector. If you are using the Firefox extension, which is still on 3.6.12.

Can you try using the webapp at [monitor.distill.io](http://monitor.distill.io) or the Chrome extension to select the elements? Thanks!

---

<div class="post-metadata">

**Author:** ![Stuckster](https://forums.distill.io/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Stuckster](https://forums.distill.io/u/Stuckster)\
**Post date:** [October 30, 2023, 2:41am UTC](https://forums.distill.io/t/monitoring-dynamically-generated-elements/2633/3 "2023-10-30T02:41:27Z")

</div>

Thanks. I reset the monitor using the updated selectors and it seems to be working well. Brilliant. Great update. Thanks so much!
