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
3
votes
0 answers

Use PuppeteerSharp in AWS Lambda function

I have a skill for the Amazon Echo. The lambda function is written in C#/.Net Core, and hosted on AWS. I now need to extend it with functionality that uses PuppeteerSharp. My first problem with this was that it downloads chromium and puts it in your…
Kevin O'Donovan
  • 1,620
  • 1
  • 13
  • 24
2
votes
1 answer

Puppeteer sharp html to pdf with links enabled

Can anyone tell me how to enable the links in pdf which are present in html. For example an a tag link. I am using Puppeteer sharp for conversion of html to pdf.
2
votes
2 answers

Launch Tor Browser with Puppeteer-sharp

I'm trying to launch Tor browser via puppeteer-sharp. I am using .net core 3.1 console application and latest version of puppeteer-sharp. So far the given the executable path console application launches the Tor Browser with an exception. using…
Selaka Nanayakkara
  • 3,296
  • 1
  • 22
  • 42
2
votes
0 answers

How to change current date-time format in the footer of a pdf document using PuppeteerSharp

I have a .Net 5 application that uses PuppeteerSharp(5.1.0) to convert Html files to pdf documents. I need to show the current date-time in the footer of the pdf document. I am using the following code to show the footer content. Footer…
asif0012
  • 31
  • 2
2
votes
1 answer

How to download a file with Puppeteer Sharp?

Here is the code that works but it doesn't wait until the completion. How do I make sure the file has been saved? var browser = await Puppeteer.LaunchAsync(new LaunchOptions { ExecutablePath = "C:\\Program Files…
Toolkit
  • 10,779
  • 8
  • 59
  • 68
2
votes
1 answer

How does puppeter sharp get the value of an attribute?

How does puppeter sharp get the value of an attribute?It seems that getting properties and controls is not as convenient as Windows Forms WebBrowser。 In the following code, I can't get the value of type var node=await page.QuerySelectorAsync("#uid"…
bbhxwl
  • 41
  • 6
2
votes
1 answer

Accessing windows.localStorage with PuppeteerSharp

Does anyone provide an example of how to access windows.localStorage using PuppeteerSharp? There are lots of examples of how to do it using (JS)Puppeteer, but I'm having problems doing it in C#. As far as I can tell, I need to use…
Hoppy
  • 720
  • 2
  • 12
  • 24
2
votes
1 answer

Thread safety of LaunchAsync() in Puppeteer

I need to use PuppeteerSharp in a multi threaded app. Can I use Puppeteer.LaunchAsync() as a singleton? Is browser.NewPageAsync() resource intensive? If it is, can I use resource pool pattern? What cleanup is needed before reuse?
frosty
  • 2,421
  • 6
  • 26
  • 47
2
votes
0 answers

Cannot enable google chrome's flag "Experimental JavaScript" via command line/puppeteer

I'm using puppeteer-sharp and here is my browser creation code Browser browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = false, Args = new[] { "--js-flags=\"--harmony\"", "--flag-switches-begin", …
IC_
  • 1,624
  • 1
  • 23
  • 57
2
votes
1 answer

Puppeteer renders blank pages when not setting breakpoints

I'm using the latest version of PuppeteerSharp and I'm having an issue with blank pages being rendered when not setting a break point. It would seem the code is not "awaiting" properly if I just let the logic go through without interrupting…
Francis Ducharme
  • 4,848
  • 6
  • 43
  • 81
2
votes
2 answers

How to use puppeteerSharp on windows 7

the requirement of PuppeteerSharp below; I don't know how to use PuppeteerSharp on Windows 7, Is there someone can show me the code ? The minimum Windows versions supporting the WebSocket library are Windows 8 and Windows Server 2012. Read more. If…
2
votes
0 answers

Rendering with Chromium direct to my own 'canvas' (e.g. GDI+)

First, a quick description of the end-goal: I'm building a cross-platform, .NET Core-based, printing app. This app will be able to print all sorts of file types with custom page settings, such as headers, footers, and margins. A key feature is it…
tig
  • 3,424
  • 3
  • 32
  • 65
2
votes
1 answer

Style Property and Values

I am extracting name and values of each element in HTML DOM. For style attribute able to extract only property names not values. My code is given below: var elementHandles = await page.QuerySelectorAllAsync("a"); foreach (var handle in…
Kishan
  • 85
  • 1
  • 7
2
votes
2 answers

Puppeteer-Sharp library did not worked and not created page in web service(wcf) project

I have some code for C# web service(WCF) and use puppeteer-sharp library. First of all, page should be created and related method located below named SayfaOlustur(). However I faced System.IO.FileLoadException exception line LaunchOptions. This code…
Mert Metin
  • 373
  • 2
  • 13
2
votes
1 answer

Puppeteer C#: Connecting to Running Chrome Instance

I am currently running PuppeteerSharp v1.19.0 to launch a browser and scrape web pages. The need has come up to be able to connect to an existing chrome instance and automate tasks. How can I achieve this one PuppeteerSharp? Via the following, I'm…
GregH
  • 5,125
  • 8
  • 55
  • 109
1 2
3
15 16