Closed nertpinx closed 6 years ago
Works like a charm! Thanks!
One more thing (just found that out) is that they don't update the menu early enough, so maybe there should be a check that the day is correct, in other words only if:
document.querySelector(".wpb_wrapper > p[align='CENTER']:nth-child(4) > span[style='color: #000000;'] > span[style='font-size: large;'] > u > b").innerText == "Polední nabídka " + t.getDate() + "." + (t.getMonth() + 1) + "." + t.getFullYear()
where t = new Date();
Otherwise it might be displaying the menu from previous day. Of course you can also choose to check the date or just change the first selector to include the first line so that it is visible for which day it is.
Sorry for the trouble :disappointed:
The problem is that the page is cached on server, so this logic needs to go there rather then to a client.
Also they stopped updating the menu two days after this issue was closed. Maybe disabling Moname is better than showing old menu now :(
@nertpinx @oskutka Moname is dead. This is their last week. It should probably be removed from the website altogether.
I figured out that the following selector works quite nicely on the page:
But it's not enough to change that and the server-side needs a change too, probably. However I don't have anything java related to spin up the whole dev env just to try it out, sorry. Anyway the change they made is mostly the fact that there is only the menu for today, there is no day mentioned there and it has a different structure.