Headless Browser Scraping
Wenn man Seiten Scrapen möchte, die sich auf JavaScript Frameworks wie React, Angula oder Vue oder andere dynamische Websites, kann man nicht einfach die HTML Dateien laden und diese Parsen. Man bekommt ein weitgehend leeres Dokument.
Die Lösung ist ein Headless Browser. Dieser lädt die Seite ohne grafisches Frontend und man analysiert anschließen das DOM mit geeigneten Tools. Die gängigen Engines Webkit und Chromium gibt es einzeln, dazu nutzt man geeignete Libraries, die den Zugriff erleichtern.
Prominente Vertreter sind (Stand 2022)
Selenium (Mit diversen APIs für verschiedene Programmiersprachen)
Puppeteer Puppeteer is a Node library that provides a high-level API to control headless Chrome over the DevTools Protocol. Also known as a Headless Chrome Node API, it is useful for automating the Chrome browser to run website tests. Fundamentally, Puppeteer is an automation tool and not a test tool. Puppeteer is a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome
Pyppeteer (Derivat für Python)
https://github.com/pyppeteer/pyppeteer
Playwright (Microsoft) Playwright is detailed as "Node library to automate Chromium, Firefox and WebKit with a single API (By Microsoft)".
https://www.youtube.com/watch?v=06HIhFcpBDo
andere (nicht näher angeschaut) Cypress, Playwright, WebDriverIO