Pricing
| Apify plan | Per page | Per 1,000 |
|---|---|---|
| Free plan | $0.003 | $3 |
| Starter | $0.0024 | $2.40 |
| Scale | $0.0021 | $2.10 |
| Business | $0.0018 | $1.80 |
| Enterprise | $0.0018 | $1.80 |
| Enterprise+ | $0.0018 | $1.80 |
Primary event rates from a catalog snapshot; this is not the total price of a run. Additional charge events and Actor Start fees may apply; start fees can scale with memory. Check the Actor's Pricing tab on Apify for all events, conditions and current plan-specific rates, and set a maximum run budget before starting.
Sample output
No recorded sample is available yet.
Call from code
Use the existing catalog input below as a starting point. Review the tool's input form on Apify before running it.
import json
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("webdatatools/css-selector-extractor-js").call(run_input=json.loads("{\n \"urls\": [\n \"https://quotes.toscrape.com/js/\"\n ],\n \"selectors\": [\n {\n \"name\": \"text\",\n \"selector\": \".text\",\n \"type\": \"text\"\n },\n {\n \"name\": \"author\",\n \"selector\": \".author\",\n \"type\": \"text\"\n }\n ],\n \"firstMatchOnly\": true,\n \"maxMatchesPerSelector\": 20,\n \"trimWhitespace\": true,\n \"maxConcurrency\": 3,\n \"waitTimeoutSecs\": 15,\n \"waitUntil\": \"load\",\n \"maxScrolls\": 10,\n \"maxClicks\": 5,\n \"blockResources\": true,\n \"itemSelector\": \".quote\",\n \"pageRange\": {\n \"from\": 1,\n \"to\": 3\n },\n \"proxyMode\": \"auto\",\n \"proxyConfiguration\": {\n \"useApifyProxy\": true,\n \"apifyProxyGroups\": [\n \"RESIDENTIAL\"\n ]\n }\n}"))
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('webdatatools/css-selector-extractor-js').call({
"urls": [
"https://quotes.toscrape.com/js/"
],
"selectors": [
{
"name": "text",
"selector": ".text",
"type": "text"
},
{
"name": "author",
"selector": ".author",
"type": "text"
}
],
"firstMatchOnly": true,
"maxMatchesPerSelector": 20,
"trimWhitespace": true,
"maxConcurrency": 3,
"waitTimeoutSecs": 15,
"waitUntil": "load",
"maxScrolls": 10,
"maxClicks": 5,
"blockResources": true,
"itemSelector": ".quote",
"pageRange": {
"from": 1,
"to": 3
},
"proxyMode": "auto",
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": [
"RESIDENTIAL"
]
}
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);curl -X POST "https://api.apify.com/v2/acts/webdatatools~css-selector-extractor-js/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls":["https://quotes.toscrape.com/js/"],"selectors":[{"name":"text","selector":".text","type":"text"},{"name":"author","selector":".author","type":"text"}],"firstMatchOnly":true,"maxMatchesPerSelector":20,"trimWhitespace":true,"maxConcurrency":3,"waitTimeoutSecs":15,"waitUntil":"load","maxScrolls":10,"maxClicks":5,"blockResources":true,"itemSelector":".quote","pageRange":{"from":1,"to":3},"proxyMode":"auto","proxyConfiguration":{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}}'