I have in the past been able to use AppleScript to get data from the web but recently ran into an issue that I thought I could solve using JavaScript with in AppleScript. I know very little about Javascript and what I have used is from ideas I have found on the web
The following script opens the 1st box using its ID. However I cannot find an ID for the next box within that 1st box.
my SelectLoc(("main-filter-button"))
to SelectLoc(LocID)
tell application "Safari"
do JavaScript "document.getElementById('" & LocID & "').click();" in document 1
end tell
end SelectLoc
I can find numerous instances of a class and the one I need to use is
Tried using the actual name of the field as in the following, as just using the name does not work I assume I need to somehow concatenate the class description, but how?
set NameLoc to " Ex-div Date"
set Namenum to 0
clickClassName(NameLoc, Namenum)
to clickClassName(NameLoc, Namenum)
tell application "Safari"
do JavaScript "document.getElementsByClassName('" & NameLoc & "')[" & Namenum & "].click();" in document 1
end tell
end clickClassName