Lol, the struggle is real! For how to locate element without using attributes, I’ve had luck with `querySelector` + `:contains` (jQuery-style) via JS.
Like:
```js
document.querySelector("div:contains('hello')")
```
Not pure CSS, but if you’re automating, Puppeteer/Playwright handle this.
Pro tip: If it’s a button or link, maybe use `getByRole` in Testing Library? Less flaky than text.
Like:
```js
document.querySelector("div:contains('hello')")
```
Not pure CSS, but if you’re automating, Puppeteer/Playwright handle this.
Pro tip: If it’s a button or link, maybe use `getByRole` in Testing Library? Less flaky than text.
