How to scan for text on a dashboard and take action based on it?

I would like to have something that scans a dashboard of home assistant for text every few seconds or so (or instantly if possible and not taking too much cpu) and if the specific string is detected, execute a action like turning on a boolean.
Would this be possible to program?

The reason i ask is that i have some tablets around the home that always show a home assistant dashboard, but time to time it suddenly reports that a custom card or element doesn’t exist, and then it will not restore itself until a refresh or restart of home assistant. So i would like to exeucte a action that when detected, it sends a command to the device in question to restart, for example.

Have you tried looking at the Scrape integration:

I would put my efforts for minimizing THIS issue

this scrapes a html page, but with home assistant itself as the host who downloads and checks the page.
I need the actual browsing device viewing the page (with the companion app in my case) to check for text, probably using javascript. if that browsing device finds it, do a refresh of the page. if thats not possible then turn on a boolean, so i can assign that to refreshing the page. that should fix the issue. it’s hacky, but i dont see a other solution. the cards that cause this are not in my control.