Javascript 使用谷歌Chrome开发工具点击;跟随;页面上的按钮
我当前的脚本:Javascript 使用谷歌Chrome开发工具点击;跟随;页面上的按钮,javascript,google-chrome-devtools,devtools,Javascript,Google Chrome Devtools,Devtools,我当前的脚本: document.querySelectorAll('.components-button components-button-size-mini components-button-type-orange desktop components-button-inline').forEach(btn => btn.click()); 我无法理解为什么它不工作,直到上周我发送脚本并点击回车按钮时,一切都正常,现在这种情况不再发生 我需要调整什么才能让它工作 链接到站点: 当
document.querySelectorAll('.components-button components-button-size-mini components-button-type-orange desktop components-button-inline').forEach(btn => btn.click());
我无法理解为什么它不工作,直到上周我发送脚本并点击回车按钮时,一切都正常,现在这种情况不再发生
我需要调整什么才能让它工作
链接到站点:当您要将包含所有指定类的元素作为目标时,需要用点分隔类名。例如:
<div class="my-class another-class" />
document.querySelector('.my-class.another-class')
以上内容将针对具有指定的三个类的元素:
某个类
,另一个类
,以及另一个类
您是否尝试过在没有foreach的情况下查看选择器是否工作?
.some-class.another-class.yet-another-class