deliter 203 Posted September 2, 2016 Report Share Posted September 2, 2016 Hey I was writing a script in Ubot 4,and the site I was trying to click elements was a nightmare,element offset was selecting too many,you cannot use click() in Ubot 4 in javascript,so made this simple command,you input a CSS Selector that matches the difficult elements to scrape,and id assigns them an ID load html("<a onClick=\"this.textContent=\'clicked\'\" href=\"#\">review</a> <a href=\"#\">review</a> <a href=\"#\">review</a> <a href=\"#\">review</a> <a href=\"#\">review</a> <a href=\"#\">review</a>") define addCSSAttribute(#CSSPath) { run javascript("for (var x = 0;x < document.querySelectorAll(\"{#CSSPath}\").length;x++)\{ document.querySelectorAll(\"{#CSSPath}\")[x].id=\"ID\"+x \}") } addCSSAttribute("a") click(<id="ID0">,"Left Click","No") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.