尝试在Google Chrome上使用AppleScript单击

时间:2019-05-31 00:23:21

标签: javascript applescript

我一直在尝试编写一个AppleScript,该脚本将在体育馆注册。我需要将日期更改为“明天”,然后单击搜索按钮。假设页面已加载,我可以使用选项卡将单选按钮切换为明天,但是我无法单击搜索。

我尝试了下面提供的代码:

tell application "Google Chrome" to activate

tell application "System Events"
    --Open village website
    key code 37 using command down
    delay 0.5
    keystroke "https://villageclubs.com/group-exercise/group-exercise-schedule/"
    delay 1
    key code 36
    delay 15

    --Process to jump to tomorrow
    repeat 31 times
        key code 48
    end repeat
    key code 124
    delay 2

    --Click search
    tell application "Google Chrome" to tell active tab of window 1
        delay 3
        execute javascript "document.getElementById('btnSearch').childNodes[0].click()"
    end tell
end tell

返回:

Get the error "Missing value"

0 个答案:

没有答案