Applescript 单击页面上的按钮时出错,";预期为行尾,但找到标识符。”;
我试图让AppleScript单击页面上的按钮,但它不起作用。我一直在“do”之后出现错误“预期行结束,但找到了标识符” 代码如下:Applescript 单击页面上的按钮时出错,";预期为行尾,但找到标识符。”;,applescript,Applescript,我试图让AppleScript单击页面上的按钮,但它不起作用。我一直在“do”之后出现错误“预期行结束,但找到了标识符” 代码如下: tell application "Firefox" activate open location "https://habitrpg.com/static/front" end tell delay 3 tell application "Firefox" do JavaScript "document.getElementsById(
tell application "Firefox"
activate
open location "https://habitrpg.com/static/front"
end tell
delay 3
tell application "Firefox"
do JavaScript "document.getElementsById('frontpage-play-button').click();" in current tab of first window
end tell
请问我哪里出错了?
提前谢谢 Firefox对applescript的支持有限,因此无法编译这些命令 另外,javascript有点不正确,应该使用
getElementsById
你可以试试Safari
e、 g,
tell application "Safari"
activate
open location "https://habitrpg.com/static/front"
end tell
delay 5
tell application "Safari"
activate
do JavaScript "document.getElementById('frontpage-play-button').click();" in current tab of front window
end tell