-
-
Save mnmkng/128cd0fe6594081ecad0bb8dbc8f7b40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PlaywrightCrawler, utils } from 'crawlee'; | |
const crawler = new PlaywrightCrawler({ | |
browserPoolOptions: { | |
// preLaunchHooks: [ | |
// (pageId, launchContext) => { | |
// launchContext.launchOptions.locale = 'cs-CZ' | |
// } | |
// ] | |
fingerprintOptions: { | |
fingerprintGeneratorOptions: { | |
locales: ['cs-CZ'] | |
} | |
} | |
} | |
}); | |
crawler.router.addDefaultHandler(async ({ request, page, enqueueLinks }) => { | |
const title = await page.title(); | |
console.log(`Title of ${request.url}: ${title}`); | |
await page.waitForLoadState('networkidle') | |
await utils.puppeteer.saveSnapshot(page); | |
}); | |
await crawler.addRequests(['https://browserleaks.com/javascript']); | |
await crawler.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment