Prompt

What's the best way to scrape data hidden behind dropdown menus?

Latest observation

Jul 15, 2026 · OpenAI APIWeb search: off

The best approach is usually to interact with the page the way a browser would, then extract the data after the dropdown changes the DOM or triggers a network request.

Best methods, in order

1. Inspect the network requests first

Often, a dropdown doesn’t “hide” data so much as it triggers an API call when changed.

What to do:

  • Open DevTools → Network
  • Change the dropdown
  • Look for:
    • fetch / XHR requests
    • JSON responses
    • query parameters that change with the selected option

If you find an API endpoint, scraping is much easier and more reliable than using a browser automation tool.

2. Use browser automation if the page is dynamic

If the content only appears after JavaScript runs, use:

  • Playwright (recommended)
  • Selenium
  • Puppeteer

Typical flow:

  • Open page
  • Select dropdown option
  • Wait for content to update
  • Read the updated HTML or visible text
  • Repeat for each option

3. Parse the updated HTML

If the dropdown updates the page without needing a separate request, you can:

  • use the browser automation tool to wait for the DOM to update
  • then extract the content from the page source

4. Simulate direct requests if possible

If the dropdown selection just changes a parameter, you can often:

  • inspect the request
  • replicate it with requests/httpx
  • loop over all dropdown values programmatically

This is usually the fastest approach.


Practical tips

Handle these common cases:

  • Dependent dropdowns: selecting one option changes the next
  • Lazy-loaded content: wait for the content container to update
  • Pagination inside dropdown results: you may need to click through pages
  • Disabled options: some values only become available after prior selections

Use explicit waits

Don’t rely on fixed sleep() unless necessary. Prefer:

  • wait for selector
  • wait for response
  • wait for text change

Keep track of:

  • option value
  • visible label
  • resulting content
  • request payload/params

Example approach with Playwright

Conceptually:

  1. Load page
  2. Select dropdown value
  3. Wait for results to update
  4. Extract data
  5. Repeat

Rule of thumb

  • If the dropdown triggers a request → scrape the request directly
  • If it only changes client-side DOM → use Playwright/Selenium
  • If the content is static in HTML → use BeautifulSoup/lxml directly

If you want, I can show you:

  1. a Playwright example,
  2. a requests-based example, or
  3. how to find the underlying API in DevTools.

Observation history

Unlock observation history

Create a free Obsurfable account to unlock historical responses, model comparisons, and deeper brand intelligence.

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, and Meta AI.