Comets
" "A comet is an icy body that releases gas, forming a visible tail, as it nears the Sun.
" "The tail always points away from the Sun, pushed out by the solar wind and radiation.
" "########################################## Turn a web page into Markdown for an LLM ########################################## Feeding a page to a language model wants the article as clean Markdown, not the raw HTML with its navigation, sidebars, and scripts. This is the fetch-then-strip-then-convert pattern behind langchain's ``BeautifulSoupTransformer`` and the markdownify loaders. turbohtml does it in three calls: parse, isolate the content, render to Markdown. Fetch the page with whatever HTTP client you use, then hand the response body to :func:`turbohtml.parse`. Here a literal string stands in for the download: .. testcode:: import turbohtml response_text = ( "
" "A comet is an icy body that releases gas, forming a visible tail, as it nears the Sun.
" "The tail always points away from the Sun, pushed out by the solar wind and radiation.
" "Read me first.