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

120
Views
Puppeteer Select Method Ignores Disabled Attribute

I have a disabled select element in an html file which I would like to check using puppeteer that it is in fact disabled. Unfortunately the page.select method seems to ignore the lock on the field element. Here is a stripped down example.

<!DOCTYPE html>
<html>
  <body>
    <select id='dropdown' disabled>
      <option value="op1">Option 1</option>
      <option value="op2">Option 2</option>
    </select>
  </body>
</html>

Now if I open this index.html I cannot change the select as expected but when interfacing with puppeteer using the page.select method I can.

const puppeteer = require('puppeteer');
const fs = require('fs');
(async () => {
  const browser = await puppeteer.launch( { headless: false} );
  const page = await browser.newPage();
  const content = fs.readFileSync('./index.html', 'utf8');
  await page.setContent(content);
  await page.select('#dropdown', 'op2');
})();

Now if I understand the puppeteer documentation correctly, then this should not result in the select option changing, but never the less it does. Am I missing something, or do I need to do something else in order to check that the element is locked.

about 4 years ago · Juan Pablo Isaza
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!