Having trouble with `await page.select` in Puppeteer? Need help with dropdown selection!

35 Replies, 3738 Views

Hey! I’d suggest checking if the dropdown is being re-rendered dynamically. Sometimes, the DOM updates after the initial load, and `await page.select puppeteer` doesn’t work because the element changes. Try using `page.waitForSelector` with the `visible` option:

```javascript
await page.waitForSelector('select#myDropdown', { visible: true });
await page.select('select#myDropdown', 'optionValue');
```

This ensures the dropdown is fully rendered before selection.

Messages In This Thread



Users browsing this thread: 2 Guest(s)