Programmatically clicking all buttons on a page in Chrome#39;s console(以编程方式单击 Chrome 控制台中页面上的所有按钮)
问题描述
我正在尝试使用 Chrome 控制台选择页面中的所有按钮并以编程方式单击它们.与我正在玩的页面类似的页面是:http://api.openstack.org/api-ref.html#compute-ext
I'm trying to use the Chrome console to select all the buttons in a page and click them programmatically. A similar page to what I'm playing with is this one: http://api.openstack.org/api-ref.html#compute-ext
我已经尝试执行下面的命令,但它没有达到我想要的效果.
I already tried to execute the command below but it didn't do what I wanted.
$("btn small info").click()
这可能吗?我应该发出什么命令?
Is this possible at all? What command should I issue?
推荐答案
好吧,您要确保只选择该部分中的按钮,这样您就不会运行搜索.
Well, you want to make sure you only select the buttons in the section so you are not running the search.
$("#body .btn").trigger("click");
这篇关于以编程方式单击 Chrome 控制台中页面上的所有按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:以编程方式单击 Chrome 控制台中页面上的所有按钮
基础教程推荐
- fetch 是否支持原生多文件上传? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
