# Webpage Text Extractor (`benthepythondev/webpage-text-extractor`) Actor

Extract clean readable text, titles and word counts from web pages.

- **URL**: https://apify.com/benthepythondev/webpage-text-extractor.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** SEO tools, Automation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Webpage Text Extractor - Clean Page Text and Word Counts

Extract readable text from public web pages in a simple structured format. The actor fetches each URL, removes noisy script, style, noscript, and SVG content, captures the page title, normalizes whitespace, calculates text length and word count, and returns one clean dataset item per page. Export to JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### What is the Webpage Text Extractor?

The Webpage Text Extractor is a lightweight website utility for content audits, research workflows, AI preprocessing, SEO checks, and monitoring. Many teams need the actual text from a page without navigation markup, JavaScript code, CSS, tracking snippets, and layout noise. This actor gives you a fast, low-cost way to collect that text from lists of URLs.

It is intentionally direct and reliable: no login, no browser, no proxy by default, and no heavy rendering. It works best on public pages where the main content is present in the server response. That includes landing pages, documentation pages, blog posts, knowledge-base articles, legal pages, public product pages, and simple marketing sites.

The output is designed for automation rather than visual browsing. It keeps the source URL, final URL, title, response content type, word count, and cleaned page text together in one row, so you can send it directly into a spreadsheet, database, classifier, enrichment workflow, or AI summarization pipeline.

#### What data does it extract?

- Input URL and normalized request URL
- Final URL after redirects
- Domain
- HTTP status code
- Page title
- Clean text preview/body
- Text length in characters
- Word count
- Content-Type response header

### Input

| Field | Type | Description |
| --- | --- | --- |
| `urls` | array | Web pages to fetch and convert into clean text rows. |

#### Example input

```json
{
  "urls": [
    "https://example.com",
    "https://docs.apify.com/platform/actors"
  ]
}
```

### Output

```json
{
  "input": "https://example.com",
  "url": "https://example.com",
  "final_url": "https://example.com/",
  "domain": "example.com",
  "status_code": 200,
  "title": "Example Domain",
  "text": "Example Domain This domain is for use in illustrative examples in documents...",
  "text_length": 178,
  "word_count": 21,
  "content_type": "text/html"
}
```

### Use cases

- SEO audits: collect titles, word counts, and page copy from large URL lists.
- AI data preparation: turn public pages into text that can be embedded, summarized, classified, or routed into a RAG pipeline.
- Compliance monitoring: check whether policy, pricing, or legal pages changed over time.
- Lead research: enrich company URL lists with page text before classification or outreach segmentation.

### Practical tips

Use this actor when you already know the URLs you want to process. If you need to discover URLs first, combine it with a sitemap actor, crawler, Google search actor, or your own list from a CRM. For AI use cases, keep the URL and title fields with the text so every downstream chunk can be traced back to its source page.

For content audits, sort by `word_count` to find thin pages, unexpectedly long pages, or pages that returned a template instead of the intended content. For monitoring, store each run's dataset and compare the `text_length`, `word_count`, and `text` fields over time.

If you are feeding results into another system, keep batches small at first and inspect a few rows manually. Website templates vary a lot, and a quick first pass helps you decide whether the direct HTML response contains enough useful content or whether a site-specific scraper would be better.

### Reliability and performance

The actor uses direct HTTP instead of browser rendering. That means it starts quickly, costs less to run, and is suitable for recurring checks. It follows redirects and processes URLs concurrently. If one URL fails, the actor logs the failure and continues with the rest of the input list.

### FAQ

**Does it extract only article text?** It extracts readable page text after removing common technical noise. It does not perform full article-readability scoring.

**Does it use a browser?** No. Direct HTTP keeps the actor fast and stable for scheduled runs.

**Will it work on JavaScript-only websites?** Only if meaningful text appears in the HTML response. Pages that render all content client-side may need a browser actor.

**Can I process many URLs?** Yes. Paste a list of URLs or call the actor through the API.

**Is the full text returned?** The actor returns up to a large text limit per page to keep dataset rows practical.

**Can I export the output?** Yes. Apify datasets export to JSON, CSV, Excel, XML, and RSS.

**Is it legal?** The actor reads public pages. You must follow website terms, robots directives, and applicable privacy or copyright rules.

**How does pricing work?** Pay-per-event billing charges per page result pushed to the dataset.

**Can I schedule checks?** Yes. Use Apify schedules to run the same URL list daily, weekly, or monthly.

**Does it store screenshots?** No. It returns text and metadata only.

**Can it extract text from PDFs?** No. This actor is for HTML pages. Use a PDF-specific actor for PDF documents.

**Can I use it for RAG ingestion?** Yes. It is a simple first step for collecting page text before chunking, embedding, or summarizing it downstream.

### You might also like

- Website Contact Extractor
- Meta Tags Extractor
- HTML Table Extractor
- Sitemap URL Extractor
- Robots Sitemap Analyzer

**Keywords:** webpage text extractor, website text scraper, page text to csv, extract website copy, SEO word count, clean HTML text, content audit tool, website monitoring, URL text extractor, page title extractor, Apify scraper, AI data preparation, RAG preprocessing, no code scraper, public web data

# Actor input Schema

## `urls` (type: `array`):

Web pages to extract readable text from.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/webpage-text-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://example.com"] }

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/webpage-text-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://example.com"
  ]
}' |
apify call benthepythondev/webpage-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=benthepythondev/webpage-text-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Cp2uurp3icCRoTsJm/builds/9g42vot8yUguwgyyx/openapi.json
