Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Apify SDK hello world example
const Apify = require('apify');
Apify.main(async () => {
const requestQueue = await Apify.openRequestQueue();
await requestQueue.addRequest(new Apify.Request({ url: '' }));
const pseudoUrls = [new Apify.PseudoUrl('[.*]')];
const crawler = new Apify.PuppeteerCrawler({
handlePageFunction: async ({ request, page }) => {
const title = await page.title();
console.log(`Title of ${request.url}: ${title}`);
await Apify.utils.puppeteer.enqueueLinks(page, 'a', pseudoUrls, requestQueue);
maxRequestsPerCrawl: 100,
maxConcurrency: 10,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.