$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "startUrls": [
< {
< "url": "https://crawlee.dev"
< }
< ],
< "maxCrawlingDepth": 1,
< "requestTimeout": 10,
< "linkSelector": "a[href]",
< "linkPatterns": [
< ".*crawlee\\.dev.*"
< ],
< "pageFunction": "from typing import Any\nfrom crawlee.crawlers import BeautifulSoupCrawlingContext\n\n# See the context section in readme to find out what fields you can access \n# https://apify.com/apify/beautifulsoup-scraper#context \ndef page_function(context: BeautifulSoupCrawlingContext) -> Any:\n url = context.request.url\n title = context.soup.title.string if context.soup.title else None\n return {'url': url, 'title': title}\n",
< "soupFeatures": "html.parser",
< "proxyConfiguration": {
< "useApifyProxy": true
< }
<}
<EOF
$curl "https://api.apify.com/v2/acts/apify~beautifulsoup-scraper/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'