HTML Parsing
The process of analyzing HTML document structure to extract specific data elements.
Parsers build a DOM (Document Object Model) tree from HTML, then use selectors (CSS, XPath) to navigate and extract data. Libraries like BeautifulSoup (Python), Cheerio (Node.js), and native browser APIs provide parsing capabilities.
ExampleParse HTML, find all <a> tags, extract href attributes
CSS Selectors
Patterns used to select HTML elements based on their tag, class, ID, attributes, or hierarchy.
CSS selectors are used both for styling and data extraction. Common selectors: tag (a, div), class (.link), ID (#header), attribute ([href]), descendants (div a). Selectors enable precise targeting of data within HTML structure.
Examplea.external-link selects all <a> tags with class="external-link"
Headless Browser
A web browser without a graphical interface, used for automated testing and scraping JavaScript-rendered sites.
Headless browsers (Puppeteer, Playwright, Selenium) execute JavaScript and render pages like regular browsers but run in the background. They handle dynamic content, form submissions, and user interactions programmatically. Essential for scraping modern SPAs.
ExamplePuppeteer renders React app, waits for content, extracts data
DOM
Document Object Model—a tree structure representation of HTML that allows programmatic access to page elements.
Browsers parse HTML into a DOM tree. JavaScript and scraping tools navigate the DOM to find, read, and manipulate elements. DOM selectors (getElementById, querySelector) enable precise data extraction from HTML structure.
Exampledocument.querySelector("a.link") finds first link with class="link"