page.setViewportSize()
(https://playwright.dev/docs/api/class-page#page-set-viewport-size)const crawler = new PlaywrightCrawler({
// Stop crawling after 5 pages
maxRequestsPerCrawl: 5,
// https://crawlee.dev/api/playwright-crawler/interface/PlaywrightLaunchContext
launchContext: {
// https://crawlee.dev/api/playwright-crawler/interface/PlaywrightLaunchContext#launchOptions
launchOptions: {
stealth: true,
headless: false,
},
?????
}, .....
launchOptions
so this should work:launchOptions: { stealth: true, headless: false, viewport: { width, height, } }
page.setViewportSize()
in preNavigationHooks