Questions tagged [puppeteer-sharp]

A .NET port of the official Node.JS Puppeteer API.

Puppeteer Sharp is a .NET port of the official Node.JS Puppeteer API.

Minimum requirements:

.NET Framework 4.6.1 and .NET Core 2.0
Windows 8 or Windows Server 2012

Resources:

Community:

226 questions
18
votes
1 answer

Puppeteer Sharp: avoid downloading Chromium (bundle Chromium locally)

I'm using Puppeteer Sharp in my .NET application to do some webpage automation tasks. However, I have to deploy my app in an environment that only has intranet access, which means Puppeteer's BrowserFetcher class is unable to download Chromium from…
Master_T
  • 7,232
  • 11
  • 72
  • 144
12
votes
3 answers

How to find or pick a suitable Chrome/Chromium revision number?

I couldn't figure out a nice way to determine a suitable revision number to use with Puppeteer Sharp. What I did was use the version lookup feature on the "OmahaProxy - Google Chrome" site. I looked-up the version of Chrome I'm running on my…
Kenny Evitt
  • 9,291
  • 5
  • 65
  • 93
7
votes
3 answers

How to get text out of ElementHandle?

Using PuppeteerSharp, I am trying to get the text of the element. ElementHandle elementHandle = await page.XPathAsync("//html/body/div[1]/section/div/section/h2")[0]; Now that I have the element handle, how do I actually get the text from it? I…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
7
votes
1 answer

How do I get readable browser/page errors out of puppeteer-sharp?

I am using puppeteer-sharp to render some pages as PDFs. I'd like to know if the page has any issues rendering at runtime in the browser, so I set up some event handlers: _page.Error += (sender, args) => { …
ldam
  • 4,412
  • 6
  • 45
  • 76
6
votes
1 answer

Puppeteer LaunchAsync Hangs Without Opening Browser

I have a .Net application that uses PupperteerSharp to navigate to different web pages, I have only one browser running at a given time and once that browser process is completed, it's closed before opening a new browser Previously I had the…
AmilaKR
  • 83
  • 5
6
votes
1 answer

Puppeteer Sharp - get html after js finished running

I am using .net core 3.1 and Puppeteer Sharp 2.0.4. I want to get the full page HTML from a web page after the JavaScript has finished running. This is my code: await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision); Browser…
DinaF
  • 101
  • 2
  • 7
6
votes
0 answers

Puppeteersharp Error: Navigation failed because browser has disconnected

I am trying to navigate a page and then I would like to access some page elements but I got those errors which I sated below. I shared my code below, you can try it. How can I solve this issue? Puppeteersharp Version: 2.0.3 Operation System: Windows…
leo
  • 445
  • 8
  • 25
6
votes
3 answers

Puppeteer-Sharp still appear many chromium instance in Process Task Manager when console app is shutdown

I have a problem when using the puppeteer that are: I built a console app to craw data using puppeteer, but when my app is shutdown, I still see many chromium appear in Processes Task Manager. Can you help me resolve this problem please?
uypc
  • 71
  • 1
  • 4
5
votes
1 answer

Failed to launch Base! /app/.local-chromium/Linux-706915/chrome-linux/chrome: ... libX11.so.6

I have an instance of puppeteer-sharp running on ASP.NET Core 3.1 that works fine locally. For deployment, it gets built in a docker container and deployed to a K8 dev cluster. The docker container builds fine, but the app fails at runtime with the…
Dezzamondo
  • 2,169
  • 2
  • 20
  • 33
5
votes
1 answer

Can't read document.cookie client side

Javascript gives error: "DOMException: Failed to read the 'cookie' property from 'Document': Access is denied for this document." Iv'e set all cookies to use use HttpOnly = false but it do not seem to help. The page works perfectly if I call the…
Blue
  • 81
  • 5
5
votes
1 answer

How to await an async function evaluation in PuppeteerSharp

In Puppeteer you can evaluate async functions: await page.evaluate(async () => { // await some promise }); Is there an equivalent in PuppeteerSharp? Using EvaluateFunctionAsync, the task completes before the promise resolves: await…
Eric Eskildsen
  • 4,269
  • 2
  • 38
  • 55
4
votes
1 answer

Cancel Downloading in PuppeteerSharp

I need to check if the file size is more than a given size, cancels the download. Here is my LaunchOptions: var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, ExecutablePath = ChromePath, IgnoreHTTPSErrors =…
Inside Man
  • 4,194
  • 12
  • 59
  • 119
4
votes
0 answers

Puppeteer: screenshots in headless Chromium result in blocky gradients

I have a web page with a linear gradient background: linear-gradient(180deg, #7e7e7e 0%, #454545 100%); When I take a PNG screenshot with PuppeteerSharp, it looks fine. However, if I enable headless mode, the gradient looks really blocky, as if…
4
votes
2 answers

PuppeteerSharp in IIS

I am facing a bit of an annoying situation. We try to use PuppeteerSharp in our application to generate background PDF, and while it works well in dev mode, it doesn't work when in production. The app is a WebAPI 2.0 site, .NET4.7.1, Windows 10…
Hugues Stefanski
  • 1,172
  • 1
  • 7
  • 11
4
votes
2 answers

How to send data to WebSocket using Puppeteer

I use puppeteer-sharp to dump data received and send by page via websockets. The code to dump data in C#: async Task Dump() { var client = await _browser.Page.Target.CreateCDPSessionAsync(); await client.SendAsync("Network.enable"); …
DanilaNV
  • 169
  • 2
  • 4
  • 13
1
2 3
15 16