View as Markdown
WebScraping.AI icon

WebScraping.AI ACTION

Scrape Website Text

Returns the visible text content of a webpage specified by the URL. See the documentation.
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's WebScraping.AI account once, then configure and run Scrape Website Text from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "webscraping_ai-scrape-website-text",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    webscraping_ai: { authProvisionId: "apn_xxxxxxx" },
    targetUrl: "Target URL",
    headers: "Headers",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Scrape Website Text inputs
Property Type Description
targetUrl Target URL string
The URL of the webpage to scrape.
Required
headers Headers object
HTTP headers to pass to the target page
Optional
timeout Timeout integer
Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 30000).
Optional
js JS boolean
Execute on-page JavaScript using a headless browser (true by default)
Optional
jsTimeout JS Timeout integer
Maximum JavaScript rendering time in ms. Default: 2000
Optional
waitFor Wait For string
CSS selector to wait for before returning the page content. Useful for pages with dynamic content loading. Overrides js_timeout.
Optional
proxy Proxy string
Type of proxy, use residential proxies if your site restricts traffic from datacenters (datacenter by default). Note that residential proxy requests are more expensive than datacenter, see the pricing page for details.
Optional
country Country string
Country of the proxy to use (us by default)
Optional
customProxy Custom Proxy string
Your own proxy URL to use instead of our built-in proxy pool in "http://user:password@host:port" format (Smartproxy for example).
Optional
device Device string
Type of device emulation. Default is desktop
Optional
errorOn404 Error on 404 boolean
Return error on 404 HTTP status on the target page (false by default)
Optional
errorOnRedirect Error on Redirect boolean
Return error on redirect on the target page (false by default)
Optional
jsScript JS Script string
Custom JavaScript code to execute on the target page. Example: document.querySelector('button').click();
Optional
textFormat Text Format string
The format of the returned text content. Default: json
Optional
returnLinks Return Links boolean
Whether to include links in the returned text content. Works only when Text Format is json.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
webscraping_ai-scrape-website-text
Version
0.0.2
App
WebScraping.AI
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes