gpt4 book ai didi

linux - 用于使用 xautomation 登录网页的 Shell 脚本

转载 作者:太空宇宙 更新时间:2023-11-04 12:40:32 25 4
gpt4 key购买 nike

尝试通过 xte (xautomation) 登录到我基于 linux 的信息屏幕上的网页。浏览器打开后,它应该执行这个 shellscript。

#!/bin/bash
# login-link focus with tab
times=7
for i in $times {
xte 'key Tab'
}
xte 'key Return'
# input login credentials
xte 'str mail@provider.com'
xte 'key Tab'
xte 'str password'
# set cookie checkbox
xte 'mousemove x y'
xte 'mouseclick i'
# login
xte 'key Return'

它在出现语法错误的第一个 xte 命令处停止。我不知道为什么。当我手动执行命令时,它工作得很好。

最佳答案

如下更改您的 for 循环;

#!/bin/bash
# login-link focus with tab
times=7
for ((n=0;n<$times;n++))
do
xte 'key Tab'
done
xte 'key Return'
# input login credentials
xte 'str mail@provider.com'
xte 'key Tab'
xte 'str password'
# set cookie checkbox
xte 'mousemove x y'
xte 'mouseclick i'
# login
xte 'key Return'

关于linux - 用于使用 xautomation 登录网页的 Shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40379030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com