liveBook · Manning

HTML

As explained in Effective Data Analysis

HTML is a markup language used to structure content in documents displayed by web browsers.

HTML structures web pages and carries their content, including headings, images, links, paragraphs, sections, styling references, and script references. Its elements use tags such as <p>, <a>, and <div>, which can nest in a tree-like document structure. section 10.2.1

For data work, an HTTP request to a web page returns HTML rather than JSON. The analyst must interpret the document, select relevant tags, and extract information that can be transformed into structured data. section 10.2.1 section 10.4

Inspecting a weather page

A weather forecast page can be requested with Python, then parsed with BeautifulSoup and the html.parser parser. Printing the prettified result exposes the nested HTML structure used to locate forecast values. section 10.2.1

HTML-based extraction requires attention to:

  • Select information from relevant tags, such as headers, links, paragraphs, or sections. section 10.4
  • Expect brittle processing when websites change their dynamic content or structure. section 10.4
  • Follow website rules, including permitted pages and rate limits, to avoid blocked requests. section 10.4

How Effective Data Analysis covers it

How deep it goes
Explains tags, nesting, classes, and parsing with BeautifulSoup, but stops short of detailed HTML language semantics.
Examples
Uses a National Weather Service page, nested tags, response text, and BeautifulSoup output as concrete examples.
What it assumes
Assumes HTTP-request familiarity and distinguishes HTML responses from JSON responses before teaching tags and nesting.
What you can do after
Apply it via Python requests and BeautifulSoup to inspect web pages and extract selected content for analysis.
How it connects
Connects HTML with web scraping, HTTP requests, APIs, JSON, CSS, JavaScript, and regular expressions.

Also explained in

Compare how 12 books explain HTML →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Data Analysis. The section links point to the parts of the book it draws on.