---
source_url: "https://www.firecrawl.dev/glossary/web-extraction-apis/how-to-extract-only-main-content-from-web-page"
title: "How to extract only main content of text from a web page? | Firecrawl Glossary"
mirrored_at: 2026-08-25T13:02:45.567Z
host: www.firecrawl.dev
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/www.firecrawl.dev/glossary/web-extraction-apis/how-to-extract-only-main-content-from-web-page"
---

> **Original source:** https://www.firecrawl.dev/glossary/web-extraction-apis/how-to-extract-only-main-content-from-web-page

Main content extraction strips away navigation, ads, footers, and scripts to isolate core text. Approaches include DOM heuristics that identify content-dense areas and AI-powered extraction. Firecrawl's `onlyMainContent` option returns clean [markdown](https://www.firecrawl.dev/glossary/web-extraction-apis/what-is-html-to-markdown-conversion-web-scraping) without boilerplate—ideal for AI applications and RAG systems.

Web pages contain far more than their primary content. A news article includes menus, related links, ads, and footers. For AI training, search indexing, or content analysis, only the article matters.

The [DOM structure](https://www.firecrawl.dev/glossary/web-extraction-apis/what-is-document-object-model-dom) provides clues: high text density and low link density indicate content; many packed links suggest navigation. Semantic tags like `<article>` and `<main>` help identify primary content.

Firecrawl handles this automatically:

```
result = app.scrape_url("https://example.com/article", {
    "formats": ["markdown"],
    "onlyMainContent": True
})
```

For LLMs, this matters significantly—clean content focuses model attention on relevant information instead of wasting tokens on navigation.

Main content extraction isolates core text by removing boilerplate. [Firecrawl](https://www.firecrawl.dev/agent) extracts main content automatically, returning clean markdown ready for AI processing without custom extraction logic.