Long pauses when jobs are no longer available due to SELECTION_EMPTY error

I’m using the firefox extension on my PC with a page that requires a login. So the page appears to load within 1 second when I navigate to it manually, but for some reason on the watchlist page where it shows whether the monitor is checking, waiting, or what the last check time was, the monitor gets stuck on checking for around 40 seconds if I had to guess. I’m also noticing when it does a check, it opens a pinned tab rather than a separate tab like it used to, and the tab stays open without closing for a while. Here’s the config for the source section:

{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "xpath",
              "expr": "//div[@id='projectContent']/div[@class='accordion-inner']//div[@class='list_container']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            },
            {
              "type": "xpath",
              "expr": "//div[@id='logo']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text",
  "regexp": {
    "expr": "",
    "flags": "gim"
  }
}

For the errors, I’m getting “selection_empty” errors, but that never seemed to cause this huge delay in the past (maybe I’m misremembering though). Here’s a screenshot of what my settings look like.

Hello @urkurkl, is the main problem here that the checks error with SELECTION_EMPTY error? In case the extension doesn’t find the selected content in a page, it waits for 30 seconds for any dynamic content to load (after page has loaded).

What does the snapshot of the page look like in error details?

Here’s a screenshot (excluding personal details). I’ve used distillio in the past, but I don’t recall it waiting 30 seconds upon getting SELECTION_EMPTY errors. Basically, what I’m doing is monitoring for jobs to show up on this page that I can claim which match certain criteria based on which filter I’m using, e.g, only match jobs that pay over $5.00. Sometimes there’s no jobs on the market at all, hence the SELECTION_EMPTY error. Should I change how my monitor works so it doesn’t get selection_empty errors?

It will be a good idea to select elements from the page when there are no more jobs being listed. That way, it will find the elements it is looking for quickly. Here are the steps to do that:

  • Navigate to the monitor’s Options page.
  • Open the visual selector.
  • Select the new elements from the page.
  • Ensure that you do not delete the previously selected elements.
  • This process allows the monitor to locate elements effectively, regardless of whether job listings are present or not.

Hope this helps!

1 Like

Thanks, I fixed the selection_empty error by selecting an outer element that doesn’t disappear when the market is empty, and so now the pauses are no longer there. :wink:

Actually it looks like this setup isn’t going to work for me after all since I have to choose a parent div that’s permanently on the page in order for this to work–that means that regex that excludes jobs I’m not interested in won’t work since I need to blacklist a lot more stuff that’s contained underneath the parent div whenever it’s populated with jobs. Is there a way to disable this behavior of waiting 30 seconds for dynamic content to load?

1 Like

It is not possible to reduce the time that Distill waits for because it is hardcode in the module. We will think about making this configurable in the future. There are two ways that should work well in your case:

  1. By adding selections from the second page, you can monitor content from both pages. This is the best approach in my opinion.
  2. Alternatively, you can select the page’s title. Following post shows an example of how it was done in a similar case: How to fix SELECTION_EMPTY error for courses.students.ubc.ca? - #4 by ajitk

Note that you can update your regex to match a word or phrase from the added content.

Thanks, but I’m not sure if I’m doing #2 right. I selected the title div for the whole page which is always present. I then waited for a job to be available so that I could select the div containing said job via distillio’s “open webpage selector,” but I’m still getting “selection empty” errors if there’s no jobs available. As for #1, it doesn’t seem applicable since there’s only 1 page of jobs that I’m wanting to monitor.

Sorry about the confusing statement about the 1st solution. You have to reopen the visual selector for the same monitor, the URL doesn’t need to be changed. By “second” page, I meant the second state of the page when no job is displayed.

Re #2, can you please share the monitor’s config?

No problem. Here’s the elements that I’ve selected. The first image shows the case when jobs are available, and the second image shows the case when no jobs are available (added the second image to a separate post due to forum limitation for new users). Both images are for the same exact URL with no pagination involved.

Regarding the monitor config, here it is:

{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "xpath",
              "expr": "//div[@id='projectContent']/div[@class='accordion-inner']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            },
            {
              "type": "xpath",
              "expr": "//div[@id='logo']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text",
  "regexp": {
    "expr": "",
    "flags": "gim"
  }
}

I think that the selected logo contains an image. That is why monitored text was empty. Can you try the following config instead?

{
  "selections": [
    {
      "frames": [
        {
          "index": 0,
          "excludes": [],
          "includes": [
            {
              "type": "xpath",
              "expr": "//div[@id='projectContent']/div[@class='accordion-inner']",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            },
            {
              "type": "xpath",
              "expr": "//title",
              "fields": [
                {
                  "name": "text",
                  "type": "builtin"
                }
              ]
            }
          ]
        }
      ],
      "dynamic": true,
      "delay": 2
    }
  ],
  "ignoreEmptyText": true,
  "includeStyle": false,
  "dataAttr": "text",
  "regexp": {
    "expr": "",
    "flags": "gim"
  }
}

I have update it to monitor the title element that is present in all pages.

Hi,
i am using chrome and set up monitoring an amazon item.
The item is most time not avaible and sold by third party seller with high price, mostly unchanged.
So i use istill to monitor the high price , if there is a change it should inform me by email oder phone.
But Nothing happend acutally expect this error “selection_expty error encountered”
If the page is changed it should inform me not showing an error.

Hello @bashgiver - you should be to able to get notifications using the methods mentioned earlier in this thread. The easiest thing you can do it include the product title in list of selected elements. If you need help updating an existing config, feel free to share that here. I will update it and share with you.