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
0
votes
1 answer

How to get Angularjs scope variable after reloadWithDebugInfo?

I have an angularjs web page and want to get the specified element's scope. But after executing the reloadWithDebugInfo function, the result is null; private Page _page; private Browser _browser; private async void…
RED-C0DE
  • 11
  • 2
  • 4
0
votes
0 answers

Can't download the page to click on a button using Puppeteer for C#

I'm running the following code from the docs. PuppeteerSharp.Browser browser = await Puppeteer .LaunchAsync(new LaunchOptions { Headless = true }); Page page = await browser.NewPageAsync(); Response x = await…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
0
votes
1 answer

How to use PuppeteerSharp inside an UWP App?

I'm trying to use PuppeteerSharp inside an UWP app. All the dependencies seem fine but I got a permission problem with the location of chromium. Access to the path "{AppRoot}\bin\x86\Debug\AppX\.local-chromium" is denied. File permission is very…
jurihandl
  • 665
  • 1
  • 9
  • 24
0
votes
0 answers

Using PuppeteerSharp with .net core api

I am following the sample "PupppeterSharpAspNetFrameworkSample" (4.7.2). However I cannot get it work. Is is possible to please provide some code or a link on how this word work in a .net core api 2.2? public class BrowserClient { private static…
rizan
  • 339
  • 1
  • 3
  • 16
0
votes
2 answers

PupeteerSharp - How to determine element type

I am pulling a list of input elements from a page and would like to determine the "type" of each one. For instance: var elements = await page.QuerySelectorAllAsync("input"); if (elements != null) { foreach (var element in…
Ray
  • 1,413
  • 2
  • 10
  • 12
0
votes
0 answers

PupeteerSharp - Feature For Browser Lock

I am trying to scrape hyperlinks that are initiated by JS. The problem is when I click on items such as tags, the browser navigates away in the "Request" event. Then all of the following elements error out when clicking because the page is no…
Ray
  • 1,413
  • 2
  • 10
  • 12
0
votes
1 answer

Change from JS Puppeteer code to PuppeteerSharp C#

I have Javascript puppeteer code, and PuppeteerSharp for C#. I know that this libraries are similar, and i know their sites. But my problem that i barely can manage this libraries, there are alot of methods for each lib, and it hard to find needed…
0
votes
1 answer

how to disable images in puppeteer sharp?

im using this code to disable images in the page loading, but doesn't work: _page = await _browser.NewPageAsync(); await _page.SetRequestInterceptionAsync(true); // disable images to download _page.Request += (sender, e) => { if…
RED-C0DE
  • 11
  • 2
  • 4
0
votes
0 answers

Is it possible to convert part of the webpage to PDF using puppeeter sharp?

Is it possible to convert part of the web page to PDF using a HTML element by its name or ID in puppeteer sharp. If so please provide a example code. Is there any workaround to achieve this?
john
  • 57
  • 1
  • 5
0
votes
2 answers

Detecting rendering events / layout changes (or any way to know when the page has stopped "changing")

I'm using Puppeteer (PuppeteerSharp actually, but the API is the same) to take a screenshot of a web page from my application. The problem is that the page does several layout changes via JavaScript after the page has loaded, so a few seconds pass…
Master_T
  • 7,232
  • 11
  • 72
  • 144
0
votes
1 answer

BrowserFetcher exit application using await

I'm using Puppeteer-Sharp to download the html of a site, I created a method called GetHtml which return a string that contains the site content. The problem is that when I call the line await new…
Charanoglu
  • 1,229
  • 2
  • 11
  • 30
-1
votes
2 answers

Pupperteer-sharp Get innerText of Clicked element

How do I get the inner text of an element that has been click? string xplast = "//button[@id='test']"; IElementHandle last = await ((IPage)page).WaitForXPathAsync(xplast); await last.FocusAsync(); await last.ClickAsync(); string innertext = (await…
-1
votes
2 answers

How to get innertext of all li elements in an list with puppeteer-sharp and XPath in C#

I am trying to get all the innertext from a list of "li"-elements. It seems I am hitting something, there are 19 elements in the variable has, but I don't know how to pick out the actual innertext values: string xpath =…
-1
votes
1 answer

PuppeteerSharp best practices

Are there any best practices to follow when using PupperteerSharp? I've seen some properties like EnqueueAsyncMessages and EnqueueTransportMessages but can't find any good explanations on when is best to turn them on/off and if they make any…
-1
votes
1 answer

Evaluate Fetch Api in PuppeteerSharp

What is the c# alternative of the java code below? await page.evaluate(() => { return fetch('url', {method: 'POST', body: 'test' }); }); I need to send a post request using PuppeteerSharp. There are several ways but it seems it is the easiest…
Inside Man
  • 4,194
  • 12
  • 59
  • 119
1 2 3
15
16