passwords - 使用 AppleScript 输入用户名和密码
问题描述
我正在尝试登录 members.nwmls.com
我使用了以前工作过的代码按类和 ID 调用元素,但它们都不起作用。
有人可以帮我确定输入密码需要写入的参数吗?
to inputByID(theId, theValue) -- creates the function
tell application "Safari" -- tells AppleScript to use Safari
do JavaScript " document.getElementsById('" & theId & "').value ='" & theValue & "';" in window 1 -- gets the ID that we specified and then inputs the value we specified into the ourform
end tell -- stops using safari
end inputByID --marks the end of the function
tell application "Safari"
tell window 1
set current tab to (make new tab with properties {URL:"http://members.nwmls.com"})
end tell
delay 1
repeat until (do JavaScript "document.readyState" in document 1) is "complete"
end repeat
delay 5
inputByID("clareity", "username")
end tell
谢谢
缺口
解决方案
推荐阅读
- python - 在 A* 搜索中计算自定义成本函数
- python - MEXOR Codechef 十月挑战
- ruby-on-rails - 返回子类常量数组的不同元素
- java - org.springframework.http.converter.HttpMessageNotReadableException:缺少所需的请求正文 Spring boot 项目
- css - CSS卡片翻转效果——如何让它每次点击都向同一个方向翻转?
- google-data-studio - 将数据源从一个连接器迁移到另一个连接器
- spring-batch - Spring-Batch Reader 在 excel 中读取多张工作表
- python - ValueError:错误的项目数通过 3,位置暗示 1
- javascript - 如何删除数组的某个项目?
- python - 如何在 SQL Server 机器学习服务中执行 python '.py' 文件?