Hello, First time poster here.
I’m trying to select the correct element to submit with a javascript command.
Here is the piece of code representing that. This code allows me to select the correct element, but sometimes the order changes within the table… :
tell application "Google Chrome"
tell window 1
tell tab 1
execute javascript "document.getElementsByTagName('form')[2].submit()"
end tell
end tell
end tell
Here is a sample of the html (there are multiple td elements with form tag elements within them)
The button i want to submit is value=“input3”, but it’s not always there. Some tables only have 1 or 2.
How can i use applescript to select the correct form tag within the correct table?
Please let me know if I need to clarify anything. Thanks.