chrome-aws-lambda
chrome-aws-lambda copied to clipboard
Airbnb site screenshot only displays header and footer not content inbetween
Ok so when trying to capture this link https://www.airbnb.com/rooms/45813399 it only captures the header and footer. sorry for the ugly formating i can't get it to align right.
` const browser = await chromeLambda.puppeteer.launch({ args: chromeLambda.args, defaultViewport: chromeLambda.defaultViewport, executablePath: await chromeLambda.executablePath }); const page = await browser.newPage(); await page.goto(url, { waitUntil: ['load', 'networkidle0'] }).catch((err) => { logger.log('error', 'Goto error', {adid: adid, url: url, err}); }); await page.waitForTimeout(2000);
seconds = Math.round(d.getTime() / 1000);
filename = imgFolderLoc + '/filename_0.png';
allFileNamesArr.push(filename);
await page.screenshot({
path: filename,
type: 'png',
fullPage: true
});
`
I have tried changing the useragent, changing setViewport and a lot of other settings. The only way i can get it to capture is by capturing it as a pdf but the image is so blurry you can't even use it. This code works just fine on other sites. Can someone please help me with this. Sorry if this is not the location to post this but i thought the community here could help here. Thank you for any help you can give.