How to locate element without using attributes - Any reliable methods? or What are the best ways to l

16 Replies, 1229 Views

Bro, just use `document.getElementsByTagName('*')` and loop through ’em till you find your element.

Kidding… kinda. For real tho, if the element has *any* unique text, `contains()` is your best bet. Flaky? Maybe. But sometimes flaky works.

Also, check if the element has event listeners—might help ID it. DevTools > Elements > Event Listeners tab.

Messages In This Thread



Users browsing this thread: 1 Guest(s)