首页 > 技术文章 > 浏览器js调试

steinven 2020-09-10 00:16 原文

经常忘记,还是需要记录一下啊

  1. 右键,检查元素
  2. 在元素DOM节点右击,复制CSS选择器
function sleep (time) {
  return new Promise((resolve) => setTimeout(resolve, time));
}

(async function() {
  for(var i=0;i<100;i++){
      console.log('current ' + i);
  		document.querySelector(".undefined > span:nth-child(1)").click();
      await sleep(3000);
}
})();

推荐阅读