Use Scrape on sites where Index varies over time for a value?


I was using scrape to get the menu for the school meal each week.
There were 2 different meals each day, no problem to scrape this with Index for each meal each day.

Index 0 and Index 1
Index 2 and Index 3 and so forth for the whole week, and the same for the week after.

This year the school got a new supplier for meals.
And now it got a little too tricky for me :slight_smile:

During the week they have 12 meals, someday 2 someday 3, but there is no pattern in what day they have 2 or 3 meals to choose.
Monday always before hade Index 0 and 1 for the different meals, but could now also have Index 2, this means that Tuesday that before always had Index 2 and 3 now could have Index 2 and 3 or 2, 3 and 4 or 3 and 4 and so on, I think you get it :slight_smile:

This means that my old code no longer work :frowning: and I don’t know how to solve this.

I can read the day with Index no problem.
Is there any way to dynamic lookup how many Index there is for a day and sort them “below” the day of the week or something like that?

Maybe scrape no longer is the method for this?

Appreciate all help and points in the right direction.

Kind Regards

Scrape is rarely the proper solution solution nowadays.

If the site has any kind of fancy javascript, there is a decent probability that there is a json API behind.
Use the “developer tools” of your browser to see all the calls that are made when you open the page. You might find an api call returning json in the list…