Closed DoYouKnowTheAnswer closed 3 years ago
This is probably out of scope for this. I'd suggest using a headless web browser instead.
Most cookie consent dialogs are implemented with JavaScript, and thus are invisible to simple crawlers.
The real problem with this particular page is not the cookie consent modal. The problem is that the data is loaded with Ajax. Check your browser's network tab, you likely want to request that JSON-serving endpoint directly instead.
The website I'm attempting to scrape has a pop-up modal on the initial page load. It requires you to click the "Accept All Cookies" button before allowing access to the page.
How do I bypass this?
Current code:
The OnHTML function never runs because it either needs a cookie in the context or that button needs to be clicked. How do I resolve this?