【问题标题】:Unable to get button ID in Chrome with AutoHotKey无法使用 AutoHotKey 在 Chrome 中获取按钮 ID
【发布时间】:2016-07-21 08:45:39
【问题描述】:

我习惯了 AHK 自动执行我在网络上执行的一些重复性任务。我正在尝试更多地研究这个漂亮的程序,并将其扩展到将来执行更复杂的任务。现在,我试图让他做而做不到的是,让他获取网页上单个按钮的ID并在其上使用命令.click(),然后弹出一个警告框。

<button id="demo" type="button" onclick="alert('Hello world!')">Click Me!</button>

这是我的 .ahk 代码:

^p::
wb = WBGet()
wb.document.getElementById( "demo").click()

return

我想知道也许有一天 chrome 可以使用 Autohotkey?我已经尝试了很多方法让它工作,但因为我认为 Chrome 不使用 COM,所以 autohotkey 无法检测到它。我认为 Autohotkey 是一个很棒的程序,但唯一的缺点是它只能自动化 IE...

【问题讨论】:

    标签: javascript google-chrome autohotkey


    【解决方案1】:

    首先你需要确保函数“wbget()”是为 chrome 编写的,据我所知“wbget()”是为 IE 编写的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多