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

34 Replies, 3397 Views

Hey! I’ve had this issue before, and it was because the dropdown was being populated by an AJAX call. I used `page.waitForResponse` to wait for the network request to complete before using `await page.select puppeteer`.

```javascript
await page.waitForResponse(response => response.url().includes('your-api-endpoint'));
await page.select('select#myDropdown', 'optionValue');
```

This might help if the dropdown is dynamically loaded via an API.

Messages In This Thread



Users browsing this thread: 1 Guest(s)