Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
turbohtml
Logo
turbohtml
  • Tutorials
    • Getting started
    • Tokenizing a document
    • Parsing a document into a tree
    • Building and editing a tree
    • Exporting to text
  • How-to guides
    • Parse HTML into a tree
    • Tokenize HTML
    • Work with forms
    • Edit the tree
    • Handle character encodings
    • Select elements with a CSS selector
    • Find elements with the find filter
    • Extract strings and attributes
    • Query a tree with XPath
    • Inspect a node you already hold
    • Trim a document to a selector
    • Chain queries like pyquery
    • Match elements the soupsieve way
    • Sanitize untrusted HTML
    • Find and rewrite links
    • Minify HTML and JavaScript
    • Translate a CSS selector to XPath
    • Read tables into rows and records
    • Extract the main article
    • Extract structured data
    • Build HTML with E
    • Serialize a tree to HTML
    • Export a tree to Markdown
    • Export a tree to plain text
    • Escape and unescape text
    • Run turbohtml from a shell
  • Migrating to turbohtml
    • From BeautifulSoup
    • From lxml
    • From html5lib
    • From selectolax
    • From resiliparse
    • From MechanicalSoup
    • From html5-parser
    • From the standard library
    • From charset-normalizer
    • From chardet
    • From soupsieve
    • From parsel
    • From pyquery
    • From linkify-it-py
    • From bleach
    • From nh3
    • From lxml-html-clean
    • From rcssmin
    • From rjsmin
    • From jsmin
    • From minify-html
    • From htmlmin
    • From csscompressor
    • From html-sanitizer
    • From calmjs.parse
    • From lightningcss
    • From cssselect
    • From pandas
    • From w3lib
    • From trafilatura
    • From courlan
    • From extruct
    • From justext
    • From readability-lxml
    • From readabilipy
    • From metadata_parser
    • From newspaper3k
    • From boilerpy3
    • From goose3
    • From microdata
    • From news-please
    • From opengraph
    • From htmldate
    • From dominate
    • From yattag
    • From htbuilder
    • From htpy
    • From airium
    • From markyp
    • From fast-html
    • From simple-html
    • From hyperpython
    • From markupsafe
    • From markdownify
    • From html2text
    • From inscriptis
    • From html-text
  • Reference
    • Parsing
    • Nodes
    • Tokenizer
    • Detect
    • Query
    • Clean
    • Convert
    • Extract
    • Structured data
    • Build
    • Serialize
  • Explanation
    • Why a C core
    • Matching the standard library
    • Parsing: from bytes to a navigable tree
    • The node and tree model
    • Querying the tree
    • Structured-data extraction
    • Serialization and export
    • Finding the main content
    • Mutating the tree
    • Free-threading
  • Development
    • Performance
  • How turbohtml was built
  • Changelog
  • License
Back to top
View this page

Tutorials¶

Learning-oriented walkthroughs, worked end to end. Each page starts from a working environment and builds one small, runnable task at a time: every code block runs, and the prose explains it as you go. Read them in order the first time through, then jump back to whichever stage you need.

  • Getting started
  • Tokenizing a document
  • Parsing a document into a tree
  • Building and editing a tree
  • Exporting to text
Next
Getting started
Previous
Home
Copyright © 2026, Bernát Gábor and contributors
Made with Sphinx and @pradyunsg's Furo