# Scrape without JS — ScrapeNinja

> Use high-performance web scraping endpoint with Chrome browser TLS fingerprint, but without JavaScript execution and real browser overhead. See the documentation

- Key: `scrapeninja-scrape-without-js`
- Type: Action (Write)
- Version: 0.0.2
- App: ScrapeNinja (`scrapeninja`) — https://pipedream.com/apps/scrapeninja.md
- This page (HTML): https://pipedream.com/apps/scrapeninja/actions/scrape-without-js
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/scrapeninja/actions/scrape-without-js/scrape-without-js.mjs

## Description

Use high-performance web scraping endpoint with Chrome browser TLS fingerprint, but without JavaScript execution and real browser overhead. [See the documentation](https://scrapeninja.net/docs/api-reference/scrape/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | Yes | The URL to scrape. |
| `headers` | `string[]` | No | Custom headers to send with the request. By default, regular Chrome browser headers are sent to the target URL. |
| `retryNum` | `integer` | No | Amount of attempts. |
| `geo` | `string` | No | Geo location for basic proxy pools (you can purchase premium ScrapeNinja proxies for wider country selection and higher proxy quality). Read more about ScrapeNinja proxy setup |
| `proxy` | `string` | No | Premium or your own proxy URL (overrides Geo prop). Read more about ScrapeNinja proxy setup. |
| `followRedirects` | `integer` | No | Whether to follow redirects. |
| `timeout` | `integer` | No | Timeout per attempt, in seconds. Each retry will take [timeout] number of seconds. |
| `textNotExpected` | `string[]` | No | Text which will trigger a retry from another proxy address. |
| `statusNotExpected` | `integer[]` | No | HTTP response statuses which will trigger a retry from another proxy address. |
| `extractor` | `string` | No | Custom JS function to extract JSON values from scraped HTML. Write&test your own extractor on https://scrapeninja.net/cheerio-sandbox/ |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "scrapeninja",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "scrapeninja-scrape-without-js",
  arguments: {
    url: "URL",
    headers: ["Headers"],
  },
})
```

**TypeScript**

```ts
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: "scrapeninja-scrape-without-js",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    scrapeninja: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    headers: ["Headers"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "scrapeninja-scrape-without-js",
    "configured_props": {
      "scrapeninja": { "authProvisionId": "apn_xxxxxxx" },
      "url": "URL",
      "headers": ["Headers"]
    }
  }'
```

---

- App: https://pipedream.com/apps/scrapeninja.md · All apps: https://pipedream.com/apps
