Pupeteer unable to find element (dev tools show the element)
I'm currently working on a web scraping tool that extracts data from the following web page: https://www.handelsregister.de/rp_web/documents-dk.xhtml.
However, I'm running into some unexpected issues and I'm not sure how to debug them.
Here's a brief overview of the issue:
- I'm using Puppeteer to scrape data from the web page.
- The tool is able to navigate to the correct page and locate the element that I want to click.
- However, when I try to extract the element using document.querySelectorAll(), I'm not getting the expected results.
- Specifically, I'm using the following code to extract the first toggle span:
- However, firstToggleSpan is an empty object,
- whereas running the same code in the Puppeteer DevTools console, it returns the element that I want to click.
How can I debug pupeteer's page selectors and why doesn't it behave as the querySelector in the dev tools?

