I'm extracting and processing information using Keyboard Maestro from: http://www.tsunami.gov
If the site is a Tsunami warning I email my iPhone with the warning. It's a fairly simple idea, but it's not quite as easy as it sounds.
I have two different approaches to this problem.
One is to use the KM Javascript action to fetch the text I need, which seems to work, but it's hard to be sure because I can't test it properly because I don't know what the page will look like when an actual warning appears on the page. Here's the important action that makes this approach seem to work: (it was tricky finding the element name that you see below)
The other approach is to use the macOS copy command to copy all the information from the page and then try to filter out the information I don't want (or filter in the information I do want.) This is difficult because (a) KM doesn't seem to have any actions which work on paste buffers that contain RTF data, and (b) the Shell in macOS doesn't have any filters that work on RTF data either.
Am I overlooking a feature of KM or perhaps a feature in the Shell that will help me filter out the data I need from the paste buffer? I often overlook features. (I did notice that the "Write to File" action allows me to save a paste buffer in its RTF format, but that doesn't help me solve the problem.)
If not, I would suggest a new action for KM that lets me do some basic filtering on RTF data. I would like to strip out (or strip in?) either tables, or pictures/objects, or text larger than (or smaller than) a certain size. Obviously there are many other things that an RTF filter could filter on but those are the things I would use.
P.S. I did find three websites that claim to email tsunami warnings for free, but I'm a programmer, so I want to do this myself.