以编程方式单击 Chrome 控制台中页面上的所有按钮 [英] Programmatically clicking all buttons on a page in Chrome's console

查看:21
本文介绍了以编程方式单击 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 控制台中页面上的所有按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆