html DOM methods?

This may be an old subject, but is there a way to access the html DOM via AppleScript similar to JavaScript? Like document.getElementById(“id_name”). I want to create script that runs at a specified interval (like every half hour) to search through a html page for certain words. I wanted to getElementsByTagName then loop through them. If the script finds these specified words, it would then perform a certain action.

If there’s not a way o access the DOM, I would be happy just being able to import the text of an html document into a script. That way I could at least create custom methods to locate the html tags.

Much appreciated,

Rich

Maybe helpful: If you use Safari it’s possible to fire JavaScript from AppleScript.

tell application "Safari"
	activate
	tell (make new document) to set URL to "file:///Users/Klaus/AutomateSafari/styledform.html"
	set doc to document "The Starbuzz Bean Machine"
	do JavaScript "document.forms['beanform']['beans'].value = 'Guatemala'" in doc
	do JavaScript "document.forms['beanform'].elements['beantype']['whole'].checked = true" in doc
	do JavaScript "document.forms['beanform'].submit()" in doc
end tell

This works perfect. Thank you for your post.:smiley: