Selection Empty Error XPath

Hey Team!

So I have been using distill to monitor a specific item on a online retailer. A month a go I set up the monitor and was working fine. Now recently I am receiving this error. This is both on the chrome and distill servers.

Code: SELECTION_EMPTY

Msg:

Selection did not match any content

URL: https://www.fabletics.com/products/THE-TAKEOVER-PANT-PT2040694-0677

I did notice that the config XPath text the @class sometimes changes. When I update the config it works for a while then starts failing with Selection Empty Error.

Has there been a change recently?

Config:
{
“selections”: [
{
“frames”: [
{
“index”: 0,
“excludes”: [],
“includes”: [
{
“type”: “xpath”,
“expr”: “(//div[@id=‘__next’]//div[contains(@class,‘fMVznD’)]/div[contains(@class,‘jZxdKP’)]/div[contains(@class,‘ggTYPx’)]/main[contains(@class,‘eTTyfw’)]/div[contains(@class,‘ieXUXg’)]/div[contains(@class,‘kasvHk’)]/div[contains(@class,‘kGJVtM’)]/div[contains(@class,‘krEChJ’)]/div[contains(@class,‘jFedjE’)]/div[contains(@class,‘fqSIWh’)]/ul[contains(@class,‘jCCzQj’)]/li[contains(@class,‘iExRAy’)]/div[contains(@class,‘jvSgCp’)]/input[contains(@class,‘jRqUUk’)])[2]”,
“fields”: [
{
“type”: “attribute”,
“name”: “data-autotag”
}
]
}
]
}
],
“dynamic”: true,
“delay”: 15
}
],
“ignoreEmptyText”: true,
“includeStyle”: false,
“dataAttr”: “text”
}

Image of Logs:

Hi @mvilches1

Firstly, welcome to Distill’s forums!
May I kindly understand what you are exactly trying to monitor on the page? We may be able to suggest a better configuration, if we know what you’re exactly interested in monitoring.
The selector is possibly an issue because of the class names are randomly generated strings.

Cheers,
Surya

I am monitoring the button S size on the page. In the XPATH data-autotag to equal pdp-saleable-size meaning the item is available. Right now since it is not available the data-autotag to equal pdp-sold-out-size.

WebPage Selector Image
image

I would really value any suggestions this is my first time trying it out and when it was working it was great! Any help would be appreciated!

Hi @mvilches1

Can you try the following configuration:

{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "expr": "[name*='size-bottom'][value='S']",
              "type": "css",
              "fields": [
                {
                  "type": "attribute",
                  "name": "data-autotag"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 5
    }
  ],
  "regexp": null,
  "ignoreEmptyText": true,
  "includeStyle": false,
  "viewport": {},
  "dataAttr": "text"
}

Hope this helps!

Cheers,
Surya

1 Like

Hey @surya!

The changes are working and have not had any failures! Thanks so much! I do have a quick question how were you able to find the CSS information? Is there any documentation you followed? Would like to know your process!

Best,

Mike

1 Like

Hi @mvilches1

Glad to note its working well for your use-case.

Although, I tried to find the selector manually, the easiest method will be to try using Distill’s web application. At this point in time, we have deployed a more robust algorithm to generate good CSS selectors for our web app.

In fact, the web-app generated an even better selector than the one I created manually!! :slight_smile:

Cheers,
Surya

2 Likes