Advertisement
BaapJaan

Click on a specific text

May 13th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. var items = document.body.getElementsByTagName("*");
  2. for (var i = 0; i < items.length; ++i) {
  3. if (items[i].textContent == "the button text") {
  4. items[i].click();
  5. console.log("clicked", i)
  6. } else {
  7. console.log("loop",i)
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement