Honestly, looping through elements and checking `.text` is underrated.
XPath/CSS can break if the DOM changes even slightly. With Python, something like:
```python
elements = driver.find_elements(By.XPATH, "//*")
target = [el for el in elements if "your_text" in el.text]
```
Slower? Maybe. But way more reliable for tricky cases where selenium locators to find particular text fail.
XPath/CSS can break if the DOM changes even slightly. With Python, something like:
```python
elements = driver.find_elements(By.XPATH, "//*")
target = [el for el in elements if "your_text" in el.text]
```
Slower? Maybe. But way more reliable for tricky cases where selenium locators to find particular text fail.
