I haven't ever done much with AppleScript, but I'm trying to automate this process. I have a website with a Button that needs to be clicked. However the button is implemented with JavaScript/jQuery/AJAX like so:
<div id="divIdOfButton" class="someClass">
<div class="divClassOfButton someOtherClass">
<img src="imgOfButton">
<div>
...
<script type="text/javascript">
$(document).ready(function() {
$('#divIdOfButton .divClassOfButton).click(function() {
...
}}
I tried this without any luck
tell application "Safari"
activate
delay 1
set URL of first document to "http://example.com/"
do JavaScript "document.getElementById('divIdOfButton').getElementByClassName('divClassOfButton')[0].click()" in front document
end tell
I did a bunch of searching, but couldn't find anything. Would really appreciate some help.