If you’re dealing with dynamic text or i18n, XPath/CSS might not cut it.
Try regex in XPath (if your lib supports it):
`//*[matches(text(), 'your_regex', 'i')]`
Or use JavaScript executor to fetch elements by text:
```js
return document.evaluate("//*[contains(text(), 'your_text')]", document, null, XPathResult.ANY_TYPE, null);
```
Clunky, but sometimes the only way.
Try regex in XPath (if your lib supports it):
`//*[matches(text(), 'your_regex', 'i')]`
Or use JavaScript executor to fetch elements by text:
```js
return document.evaluate("//*[contains(text(), 'your_text')]", document, null, XPathResult.ANY_TYPE, null);
```
Clunky, but sometimes the only way.
