Calling Javascript function in Applescript -


i trying automate javascript function call on external webpage.

the line of code want execute triggered click of div

<div class="vote_btn 151" onclick="vote('151', 'california square red paso','145');">&nbsp;vote ►</div> 

instead of automating clicking of div, skipping calling vote function. attempting in 2 browsers. here applescript safari:

tell application "safari" javascript "vote('151', 'california square red paso', '145');" in document 1 

and chrome:

tell application "google chrome"      tell window 1          tell tab 1              execute javascript "vote('151', 'california square red paso', '145');"          end tell      end tell  end tell 

the problem is, getting weird errors. chrome, says "vote not defined" , safari "variable vote not defined". seems applescripts aren't able access javascript? know there similar questions on stackoverflow have read , tried of solutions them no successful results. appreciated!


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -