Web Scraper
Pricing
Pay per usage
Pricing
Pay per usage
Rating
2.3
(6)
Developer

Apify Technologies
Actor stats
44
Bookmarked
5.5K
Total users
295
Monthly active users
4.5 days
Issues response
10 months ago
Last modified
Categories
Share
Pricing
Pay per usage
Pricing
Pay per usage
Rating
2.3
(6)
Developer

Apify Technologies
Actor stats
44
Bookmarked
5.5K
Total users
295
Monthly active users
4.5 days
Issues response
10 months ago
Last modified
Categories
Share
You can access the Web Scraper programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you鈥檒l need an Apify account and your API token, found in Integrations settings in Apify Console.
$echo '{< "runMode": "DEVELOPMENT",< "startUrls": [< {< "url": "https://apify.com"< }< ],< "linkSelector": "a[href]",< "pseudoUrls": [< {< "purl": "https://apify.com[(/[\\\\w-]+)?]"< }< ],< "pageFunction": "// The function accepts a single argument: the \\"context\\" object.\\n// For a complete list of its properties and functions,\\n// see https://apify.com/apify/web-scraper#page-function \\nasync function pageFunction(context) {\\n // This statement works as a breakpoint when you'\''re trying to debug your code. Works only with Run mode: DEVELOPMENT!\\n // debugger; \\n\\n // jQuery is handy for finding DOM elements and extracting data from them.\\n // To use it, make sure to enable the \\"Inject jQuery\\" option.\\n const $ = context.jQuery;\\n const pageTitle = $('\''title'\'').first().text();\\n\\n // Print some information to actor log\\n context.log.info(`URL: ${context.request.url}, TITLE: ${pageTitle}`);\\n\\n // Manually add a new page to the queue for scraping.\\n await context.enqueueRequest({ url: '\''http://www.example.com'\'' });\\n\\n // Return an object with the data extracted from the page.\\n // It will be stored to the resulting dataset.\\n return {\\n url: context.request.url,\\n pageTitle\\n };\\n}",< "proxyConfiguration": {< "useApifyProxy": true< },< "initialCookies": [],< "waitUntil": [< "networkidle2"< ],< "preNavigationHooks": "// We need to return array of (possibly async) functions here.\\n// The functions accept two arguments: the \\"crawlingContext\\" object\\n// and \\"gotoOptions\\".\\n[\\n async (crawlingContext, gotoOptions) => {\\n // ...\\n },\\n]\\n",< "postNavigationHooks": "// We need to return array of (possibly async) functions here.\\n// The functions accept a single argument: the \\"crawlingContext\\" object.\\n[\\n async (crawlingContext) => {\\n // ...\\n },\\n]",< "breakpointLocation": "NONE",< "customData": {}<}' |<apify call apify/web-scraper --silent --output-datasetThe Apify CLI is the official tool that allows you to use Web Scraper locally, providing convenience functions and automatic retries on errors.
Using installation script (macOS/Linux):
$curl -fsSL https://apify.com/install-cli.sh | bashUsing installation script (Windows):
$irm https://apify.com/install-cli.ps1 | iexUsing Homebrew:
$brew install apify-cliUsing NPM:
$npm install -g apify-cliOther API clients include: