How to search the fully rendered view in Safari?


I need to search a web page for a monitored value; however, the source of the page is just JavaScript.

Normally, I would use the Get URL action in KM and then grep the results; however, in this case, I need that Get URL actually renders the page content (i.e. executing the JavaScript) and storing the results.

Is that possible?

Yes. You can use the KM Execute a JavaScript in Front Browser action.

This JavaScript will return all rendered text currently showing on the page:


You could then search that text as you like.

However, you might also be able to search/compare the exact field/text of interest, using a querySelector() statement. If you'd like help with that, please post the page URL (or HTML code in a Code Block) and screenshot of the target region with the target data clearly identified.

Thanks! This script would be monitoring the collateral ratio of an asset every five minutes, and so it wouldn't be practical to actually open the page in a Safari window. Can you think of any alternative?

Here’s an untested idea:
Leave the webpage open, and have a KM macro reload the page every five minutes and then search for the desired data.