No element found for selector: {value}

How to fix the Puppeteer error: No element found for selector: {value}


Error

No element found for selector: ${selector}

What it means

Puppeteer raised this from its frame and evaluation code. In practice, it usually means your script reached a browser, page, frame, element, or option state that the API cannot use safely.

How to fix it

  • Confirm the selector matches an element in the same frame where you are querying.
  • Wait for the element to be attached and visible before acting on it.
  • Re-query the element after DOM updates instead of reusing an old ElementHandle.

Minimal guard

try {
  // Run the Puppeteer operation that triggers this error.
} catch (error) {
  if (error instanceof Error && error.message.includes("No element found for selector: ")) {
    // Apply the fix above, then retry or fail with a clearer message.
  }
  throw error;
}

Keep Reading

Puppeteer Guides

All Guides →