tianyun há 3 anos atrás
pai
commit
b42d42a925
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      tmp/monkey/util.js

+ 4 - 1
tmp/monkey/util.js

@@ -13,11 +13,12 @@ async function getDom(sel) {
         }
     }
 }
+
 async function getDomAll(sel) {
     for (let i = 0; i < 100; i++) {
         let dom = document.querySelectorAll(sel);
         console.log(dom);
-        if (dom) {
+        if (dom.length > 0) {
             return dom;
         } else {
             await sleep(100);
@@ -47,11 +48,13 @@ function GetQueryString(name) {
     r = null;
     return context == null || context === "" || context === "undefined" ? "" : decodeURI(context);
 }
+
 function getRandomInt(min, max) {
     min = Math.ceil(min);
     max = Math.floor(max);
     return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
 }
+
 function myCopy(inner_html) {
     let tmpId = "tmpId123123" + getRandomInt(1, 10000);
     let a = document.createElement('div');