Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
Select item from website dropdown at random using puppeteer

I want Puppeteer to click a random in-stock size from the dropdown menu on this site:

https://www.shopcapcity.com/product/new-era-exclusive-59fifty-navy-light-blue-anaheim-angels-fitted-grey-uv-very-limited-2/

I can get it to click on the dropdown and bring the in-stock sizes but I can't get it to automate choosing a random item from the dropdown list

This is part of the code I have now

await page.click('#size')
await page.waitForTimeout(200)
await page.waitForSelector('#size')
await page.click('#size', '7 3/8)

What I want Puppeteer to do Is automatically click on a random size from the dropdown that is in stock but how?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!