CSS Sub-element Exclusion

Hi, the following selection config has been working for the most part, but the CSS element that is selected by the “aria-describedby” attribute has a sub-element that I would like to exclude from the selection. The sub-element has an attribute “aria-label” with value starting with "Comment by " followed by some more text. For example: ‘aria-label=“Comment by John Doe 6 days ago”’, where the name and time description often changes

Is there a way to exclude this particular sub-element? Thank you!

{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "css",
              "expr": "[aria-describedby]",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                },
                {
                  "type": "attribute",
                  "name": "aria-describedby"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text"
}
1 Like

Yes, it is possible to exclude them. There are two ways to do that:

  1. Select the child element again in the visual selector. Checkout https://distill.io/docs/web-monitor/what-is-visual-selector/#how-to-exclude-elements-from-the-selection-that-you-do-not-want-to-monitor
  2. Or, manually update the config by adding an entry in the excludes list in the config.