FREE COURSE / REAL PRACTICE
HTML, URLs & parsing
Parse local HTML, resolve and classify URL references, and produce deterministic link reports in Python.
What you’ll work toward
Build a tested local-site link audit with explicit parsing, URL identity, escaping and snapshot limitations.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
Individual lessons can add prerequisites. The course map shows your actual readiness.
A look inside the first lesson
HTML documents, elements & parser events
from html.parser import HTMLParser
class Trace(HTMLParser):
def handle_starttag(self, tag, attrs):
print("start", tag)
def handle_data(self, data):
print("data", repr(data))
parser = Trace(convert_charrefs=True)
parser.feed('<P>Fish & chips<br></P>')
parser.close()Your course outline
Follow the lessons in curriculum order. Open a unit to preview the ideas you’ll work with.
HTML structure and URL references
- LESSON 01.01
HTML documents, elements & parser events
Separate HTML source, the document tree and streaming parser events while counting elements and retaining decoded text.
Open lesson - LESSON 01.02
Extract anchors with structured HTML parsing
Collect href values and nested anchor text with explicit state, missing-value rules and whitespace policy.
Open lesson - LESSON 01.03
Resolve references against document bases
Resolve relative, root-relative, query-only and network-path references without confusing joining with validation or fetching.
Open lesson
Identity, reports and link inventories
- LESSON 02.01
Choose document identity and query policies
Normalize a documented HTTP(S) subset, retain meaningful path/query differences and inspect form-style query pairs without data loss.
Open lesson - LESSON 02.02
Escape data and serialize deterministic reports
Render inert HTML report data with context-appropriate escaping and produce reproducible JSON without mutating inputs.
Open lesson - LESSON 02.03
Group a page’s links into an inventory
Compose anchor extraction, base resolution and document identity into deterministic same-origin and external link counts.
Open lesson