AppleScript has not worked that well in my current application and I have turned to using JavaScript with in AppleScript.
tell application "Safari"
do JavaScript "document.getElementById('main-filter-button').click()"
end tell
I am doing something wrong as this returns missing value. I obtained the Id from the HTML code I scrapped from the web site as follows.
Any ideas about what I am doing incorrectly?
Thanks
button class=“mp-page-filter-all-filter-button mp-page-filter-all-filter-button__on_page 12” data-action=“click->component-render#show click->filter#popupState” data-controller=“filter” data-special-theme=“DEC_DATE_MONTH_BEFORE_NOW” id=“main-filter-button”