Cannot monitor Wolt's restaurant page for its availability

In Wolt’s restaurant page (e.g. here) there is a label of “The restaurant is temporarily offline”, whenever the restaurant currently is not taking orders. This label is hidden when the restaurant can take orders. I couldn’t find a way to define distill to monitor it, and to notify me when this label is gone.
Can you please help me how should I do it?
Thanks!

Hi @platin_00

Firstly, welcome to Distill forums!

Below is a JSON configuration to help track changes (specifically notify when the venue is closed) to the page:

{
    "client": {
        "web": 1
    },
    "data": [
        {
            "name": "Nam King George | Wolt | Delivery | Tel Aviv",
            "uri": "https://wolt.com/en/isr/tel-aviv/restaurant/nam-king-george",
            "content_type": 2,
            "config": "{\"selections\":[{\"frames\":[{\"index\":0,\"excludes\":[],\"includes\":[{\"expr\":\"[data-test-value='venue-closed']\",\"type\":\"css\"},{\"expr\":\"[data-test-value='venue-offline']\",\"type\":\"css\"},{\"expr\":\"title\",\"type\":\"css\"}]}],\"dynamic\":true,\"delay\":0}],\"regexp\":null,\"ignoreEmptyText\":true,\"includeStyle\":false,\"viewport\":{},\"dataAttr\":\"text\"}",
            "schedule": "{\"params\":{\"interval\":10800},\"type\":\"INTERVAL\"}",
            "state": 40,
            "tags": [],
            "ts": "2023-05-02T13:46:48.788Z",
            "datasource_id": null
        }
    ]
}

To import the configuration into Distill you can refer to the following page: How to Export and Import Monitors? – Distill
Furthermore, here is a youtube video which can also walk you through the steps to import the JSON.

A few things to note:

  • We track the element which has the attribute data-test-value with value being either venue-closed or venue-offline
  • We have also added the title tag on the page to be tagged, as the above element does not exist when the venue is available to take in orders. This will ensure that the monitor does not error out with a SELECTION_EMPTY error owing to the first element not being available.
  • We were able to setup the monitor when the page actually has such an element populated (with the text visible on the page).

Please feel free to reach out, if you have any additional questions

Hi surya,
Thanks for your help!

Unfortunately, I just imported your solution, and find out that they changed the way they mark a restaurant which cannot take orders, with a label of “Ordering paused”, which appears after few seconds.
Can you please help again, to get a notification when the restaurant can take orders?

Thanks again!!

Hi @platin_00

Now that the webpage has changed the way it indicates the availability of the restaurant, here are the selectors you can use to track the portion of the page that indicates availability.

You would need to use two selectors, namely - //*[contains(text(),'Ordering paused')] and //*[contains(text(),'Open until')] these in combination, will help you track for those particular texts. That is, it will check for the section of the page having the text ‘Ordering paused’ or ‘Open until’ whichever indicates the current availability of the restaurant. Whenever any of this text disappears, you will get a SELECTION_EMPTY error.

Notice the screenshot where currently the webpage I am tracking has the text ‘Ordering paused’ being tracked. Note that if more states get added, you’ll have to re-set up the monitor to include the new states.

You can import this JSON for your current case:

{
	"client": {
		"local": 1
	},
	"data": [{
		"name": "Nam King George | Thai Cook House 🇹🇭 Sawadika | Tel Aviv",
		"uri": "https://wolt.com/en/isr/tel-aviv/restaurant/nam-king-george",
		"config": "{\"selections\":[{\"frames\":[{\"index\":0,\"excludes\":[],\"includes\":[{\"type\":\"xpath\",\"expr\":\"//*[contains(text(),'Ordering paused')]\",\"fields\":[{\"name\":\"text\",\"type\":\"builtin\"}]},{\"type\":\"xpath\",\"expr\":\"//*[contains(text(),'Open until')]\",\"fields\":[{\"name\":\"text\",\"type\":\"builtin\"}]}]}],\"dynamic\":true,\"delay\":10}],\"ignoreEmptyText\":true,\"includeStyle\":false,\"dataAttr\":\"text\"}",
		"content_type": 2,
		"state": 40,
		"schedule": "{\"type\":\"INTERVAL\",\"params\":{\"interval\":10800}}",
		"ts": "2023-05-09T16:57:01.524Z",
		"datasource_id": null
	}]
}

Although, if the page layout changes again, you’ll have to modify the selectors, as your monitor will throw a SELECTION_EMPTY error. You should be well-equipped to make the modifications yourself.

1 Like

Hi Vaishnavi
Thank you very much for your help! I think I understood how it works, but I couldn’t find a way to do so using the GUI. On the next page change, I’ll probably try to modify it on the JASON itself

Thanks again!