Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk3 min

How to Extract Main Content from a URL Without Navigation, Ads, or Boilerplate

Fetch a page’s HTML, extract its main content with Trafilatura, and check for missing text or leftover navigation before using the result.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To extract a webpage’s main text without opening it in a browser, fetch its HTML over HTTP and pass that HTML to a content extractor. In Python, Trafilatura offers a simple two-step workflow: use fetch_url() to retrieve the page, then extract() to remove much of the navigation and other boilerplate. It works when the article is present in the server’s HTML response; it cannot guarantee results for JavaScript-rendered pages, access-controlled content, or bot-check pages.

Extract one URL with Python

Install Trafilatura in your Python environment, then fetch the URL and extract its main content:

As an Amazon Associate I earn from qualifying purchases.

from trafilatura import fetch_url, extract

url = "https://example.org/article"
downloaded = fetch_url(url)
text = extract(downloaded) if downloaded else None

if text:
    print(text)
else:
    print("No extractable content returned")

fetch_url() retrieves the page HTML; extract() identifies and returns the main text. The default output is plain text. Trafilatura’s documented API also supports formats such as Markdown and JSON when you need structure or metadata. See the Trafilatura documentation for current API and command-line details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A command-line workflow is also available: Trafilatura documents accepting a URL as input. This is useful for one-off extraction or shell-based pipelines. Scrapy documents a related pattern in which a crawler downloads a response and passes it to Trafilatura for extraction; that is more appropriate when you also need to discover and process multiple URLs. Extracting a single URL does not, by itself, find links to other articles.

#1 Best Overall
Sale
Bates- Long Reach Extension Scraper, 11-Inch Razor Scraper Tool
  • Bates long reach extension scraper comes with a 11-inch handle for extended reach and includes 3 double-edged plastic blades and 3 metal blades for versatile use.
  • The scraper is made from durable materials, ensuring reliable performance and long-lasting use for a variety of tasks.
  • The 11-inch handle provides enhanced leverage and control, making it ideal for hard-to-reach areas or demanding scraping jobs.
  • The interchangeable blades offer flexibility, with plastic blades designed for delicate surfaces and metal blades for tougher scraping tasks.
  • This tool is perfect for removing paint, adhesives, stickers, and other residues, making it a must-have for home improvement and professional projects.

Check that the result is actually the article

Extraction is heuristic, so inspect the output rather than assuming that a successful fetch means a successful article extraction. Treat None, unusually short text, a challenge or error message, or output dominated by menus and links as signs to investigate.

  • Too much navigation or template text: Try precision-oriented extraction with favor_precision=True. Trafilatura says this aims to reduce irrelevant material, but may also return less of the page’s text.
  • Missing paragraphs or other content: Compare the default result with recall-oriented behavior and inspect the returned HTML. A more inclusive result may recover content while also bringing back noise.
  • Inconsistent difficult pages: Trafilatura’s standard process can use fallback algorithms when the initial result is too short. Its fast mode skips fallbacks and is quicker, but may be less helpful on difficult markup.

These are trade-offs, not universal settings. Test against representative pages from the sites you need to handle and compare unwanted boilerplate, missing content, preserved structure, and processing time. A 2024 Sandia National Laboratories report evaluating seven main-content extraction libraries concluded that no single library outperformed all others; it does not establish a universal winner for every site or use case. Sandia report SAND2024-10208.

Why a main-content extractor is different from HTML-to-text

Web pages combine article content with scripts, styles, navigation, footers, and other repeated elements. Trafilatura cleans the HTML tree and scores text nodes using signals such as text length, link density, and position. Its main extractor can try fallback algorithms, including Readability and jusText. Those methods are useful across varied page layouts, but they remain heuristics: markup alone does not always reveal exactly what a publisher considers central.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not substitute a generic “all text” conversion if your goal is a clean article. Trafilatura distinguishes extract(), which targets main content, from html2txt(), which returns all page text, including navigation and footers. Scrapy describes the clean-content use case as getting “the page itself, without navigation, ads or footers” for uses such as search indexing, summarization, or retrieval-augmented generation. See Scrapy’s extraction documentation.

Rank #3
Sale
Scrigit Scraper No-Scratch Plastic Scraper Tool - 2 Pack for stickers
  • Save Your Nails with Scrigit Scraper - The ultimate multi-use plastic scraper tool works for many tasks at home or on the go; an ideal dried-on food scraper, label scraper, sticker removal tool, and even a handy chrome delete tool for automotive detailing.
  • No-Scratch Super Scraper: One side of your Scrigit Scraper tool has a flat edge that's best for flat surfaces and larger areas. The other side has a round edge, best for curved surfaces and smaller areas. Dishwasher safe and easy to hold, just like a pen.
  • Made in the USA – Let this crevice cleaning tool do the work for you in hard-to-reach areas. Made from durable plastic, it's safe for most surfaces, works great as a label remover tool, and even doubles as a lottery scratch-off tool. Proudly MADE IN THE USA!
  • Keep Handy Everywhere You Need It: Keep your slim scraper pen Scrigit tool at home, in your vehicle or office. It's the ultimate crevice tool to keep in your cleaning box to remove grime from those hard-to-reach areas of your kitchen and bathroom.
  • Convenient Size: Our slim detailing tools are 6 inches long x 3/8 inches in diameter with a convenient pocket clip. Why not buy some for your friends, because everyone can find a use for a Scrigit Scraper.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When a plain HTTP fetch cannot work

A direct request can only provide the HTML the server returns. If the article is inserted later by JavaScript, withheld behind authentication, or replaced by a bot challenge, the extractor may have no article text to identify. In that case, first determine whether the fetched HTML contains the missing content; changing extraction settings cannot recover text that was never retrieved. Trafilatura’s FAQ points users to separate guidance for JavaScript-rendered pages.

If the full document text is what you need—including menus and footers—use a whole-page conversion instead. For a clean article extraction, keep retrieval and content identification as separate steps, validate the output, and choose settings based on the pages and structure your workflow actually needs.

Rank #4
Honoson 9 Pcs Cleaning Scraper Tool, Scratch Free for Auto Detailing,None
  • Practical cleaning tools: you will get 9 piece of plastic scraper tools, enough quantity to satisfy your daily use, or you can share them with family and friends, so that you will be able to remove small amounts of various common substances easily
  • 3 Kinds of two-way scraper tools: the 3 kinds of two-way scratch free plastic scrapers are proper for various occasions; The wide scraper head can be applied to scrape wide areas, such as smudges on the ground, chewing gum, stickers, labels, etc.; The narrow scraper head can clean narrow spaces, as well as difficult to reach places of the car outside body and interior place; And the pointed scraper is very suitable for cleaning more narrow crevices, such as tight corners, edges, grooves
  • Durable material: the stiff multipurpose label scraper is made of quality carbon fiber plastic, sturdy and durable, not easy to break under pressure, with high hardness, reusable, lightweight and easy to carry; You can let the scrape cleaning tool do the job and protect your nails
  • Portable and easy to use: our cleaning pen-shaped scraper tool is 5.8 inch/ 14.6 cm long, small and convenient size for easily carrying out with you; Anytime you need it, just put it in your handbag, tool box, or anywhere proper for you
  • Wide applications: this plastic scraper tool is ideal for cleaning crevices, while protecting your nails; They are also suitable for removing label stickers, grease, paint, candle wax, dirt, soap, dried foods, ticket and more on kitchen, car, bathroom, office, motorcycle, boat, workshop, garage; It can also be applied as a pry open electronic repair tool for LCD, tablet

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.