Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

o.rka

macrumors newbie
Original poster
Jan 30, 2014
1
0
I realize there are several threads about this and they are all very specific to certain website . My background is in Python, not Javascript or Applescript, and I'm confused on exactly how to achieve this action .



I've seen several scripts doing this action, namely:

tell application "Safari"

activate

do JavaScript "document.forms['search']['order_list_search_batch'].click()"

end tell



Which is the best method to act this out ?

i'm confused on what goes in between "document.forms[WHATGOESHERE?].click()"



I'm trying to click the Proceed button on this webpage [http://rna.tbi.univie.ac.at/cgi-bin/RNAfold.cgi]



Screen+Shot+2014-01-30+at+11.22.37+AM.png




I went to "Inspect Element" on the Proceed button and got this code:



<input style="cursor: pointer;" value="" name="proceed" class="proceed" onmouseover="this.style.cursor="pointer"" type="submit">



How do I know what to put in script to click this button based off of the Inspect Element results ? I want to understand so I can use this method in more than one case . There's not a href link that it goes to . . . please help
 

Code cookies

macrumors member
Dec 23, 2011
46
47
UK
Not sure whether this is what you are looking for, but using jQuery.
$(".proceed").click();

if you wish to do it with other buttons, then just replace .proceed with what ever the class is eg .class

If the button doesn't have a class eg:

<input style="cursor: pointer;" value="" name="proceed" onmouseover="this.style.cursor="pointer"" type="submit">

Then you can use one of the other attributes eg:
$("input[name='proceed']").click();
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.