Unable to capture the full screenshot in desktop view for the website https://www.amazon.jobs/ by using PuppeteerSharp
We are using the below source code to capture the full screenshot in desktop view, but the footer is missing, Also you can see the output screenshot.
Source Code: using var browserFetcher = new BrowserFetcher(); await browserFetcher.DownloadAsync(BrowserFetcher.DefaultChromiumRevision); var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, DefaultViewport = new ViewPortOptions { Width = 1900, Height = 2000 } }); var page = await browser.NewPageAsync(); await page.GoToAsync(siteUrl, new NavigationOptions { Timeout = 100000 }); await page.EvaluateExpressionAsync("window.scrollTo(0, document.body.scrollHeight)"); await page.WaitForTimeoutAsync(4000); await page.EvaluateExpressionAsync("window.scrollTo(0, 0)"); await page.WaitForTimeoutAsync(2000); await page.ScreenshotAsync(imageSavePath, new ScreenshotOptions { FullPage = true });
Please reply as soon as...kindly help us to sort this issue.
Did you try with Headless in false?
Thanks for the reply. Yes, I have checked with the Headless = false and removed the default DefaultViewport option also but the result is the same. Also, we are facing an issue while capturing the site (https://eatfoodwithpurpose.com/). below is the attached screenshot of both mobile and desktop view (incomplete captured screenshots). Please suggest something to resolve this issue.
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = false
});
var page = await browser.NewPageAsync();
using var browserFetcher = new BrowserFetcher();
await browserFetcher.DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
await page.GoToAsync("https://www.amazon.jobs/", new NavigationOptions { Timeout = 100000 });
await page.EvaluateExpressionAsync("window.scrollTo(0, document.body.scrollHeight)");
await page.WaitForTimeoutAsync(4000);
await page.EvaluateExpressionAsync("window.scrollTo(0, 0)");
await page.WaitForTimeoutAsync(2000);
await page.ScreenshotAsync(""CapturedImage.png"", new ScreenshotOptions { FullPage = true });
[Ist Screenshot: https://www.amazon.jobs/]
[2nd Screenshot : https://eatfoodwithpurpose.com/]
(Mobile View)
(Desktop View)