Applescript / python脚本打开谷歌浏览器并登录网站?

时间:2013-11-17 13:45:57

标签: python google-chrome login automation applescript

我正在尝试编写一个苹果脚本来打开谷歌浏览器,然后登录到一个网站,比如说facebook或其他一些网站。 具体来说,我需要登录我的大学互联网使用的代理页面。 我可以尝试打开特定的URL,但实际上如何发送登录表单的数据有点棘手。

如果没有任何方法可以完全使用applescript,我们可以用python脚本做点什么吗?

感谢。

1 个答案:

答案 0 :(得分:0)

tell application "Google Chrome"
    open location "http://stackoverflow.com/questions/20031393"
    tell active tab of window 1
        repeat while loading is true
            delay 0.1
        end repeat
        execute javascript "document.querySelectorAll('#search input')[0].value='some text'"
    end tell
end tell

您可以使用.click()点击提交按钮。