Having trouble with await page.select in Puppeteer? How to fix dropdown selection issues? Alternatively:

20 Replies, 1669 Views

Hey OP, had this exact headache. Sometimes the dropdown’s options are loaded via AJAX, so `await page.select` fires too early.

Try wrapping it in a retry loop:

```javascript
let retries = 3;
while (retries--) {
try {
await page.select('#dropdown', 'value');
break;
} catch (err) {
await page.waitForTimeout(1000);
}
}
```

Also, Chrome DevTools’ "Network" tab can help spot delayed loads.

Messages In This Thread



Users browsing this thread: 1 Guest(s)