Yo! I feel you on the flakiness. One thing I’ve found helpful is using `page.waitForFunction()` to check for the element’s presence. It’s more flexible because you can write custom logic to wait for specific conditions. For example, you can check if the element is visible or has a certain attribute. Here’s a quick snippet:
```javascript
await page.waitForFunction(() => document.querySelector('.your-selector') !== null);
```
This way, you’re not just waiting for the selector but also ensuring it’s actually there and ready.
```javascript
await page.waitForFunction(() => document.querySelector('.your-selector') !== null);
```
This way, you’re not just waiting for the selector but also ensuring it’s actually there and ready.
