Skip to content

PuppeteerSharp

API reference

Browser, page, frame, element, network, and launch APIs.

Type Summary
AddScreenParams Parameters for adding a new screen.
AddTagOptions Options used by AddScriptTagAsync(AddTagOptions) & AddStyleTagAsync(AddTagOptions).
AutofillAddressData Address data for autofilling. See https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-Address.
AutofillAddressField Supported autofill address field names. See https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/fieldtypes.cc for the full list of supported fields.
AutofillAddressFieldEntry Represents a single autofill address field name/value pair.
AutofillData Data for autofilling form fields. Provide either CreditCard or Address, but not both.
BluetoothManufacturerData Represents the simulated bluetooth peripheral’s manufacturer data.
BoundingBox Bounding box data returned by BoundingBoxAsync().
BoxModel Represents boxes of the element.
BoxModelPoint Represents a point.
Browser Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
BrowserContext Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
BrowserContextOptions BrowserContext options.
BrowserFetcher Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
BrowserFetcherOptions Browser fetcher options used to construct a BrowserFetcher.
CallFrame Represents a call frame in a stack trace.
CDPSession Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
ChromeLauncher Represents a Chromium process and any associated temporary user data directory that have created by Puppeteer and therefore must be cleaned up when no longer needed.
CommandOptions Command options. See CommandOptions).
ConnectOptions Options for connecting to an existing browser.
ConsoleEventArgs Console data.
ConsoleMessage ConsoleMessage is part of ConsoleEventArgs used by Console.
ConsoleMessageLocation Console message location.
CookieData Cookie parameter object used to set cookies in the browser-level cookies API.
CookieParam Cookie data.
CookiePartitionKey Cookie partition key.
CreatePageOptions Options for creating a new page.
Credentials Options to be used in AuthenticateAsync(Credentials).
CreditCardData Credit card data for autofilling. See https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-CreditCard.
CustomQueryHandler Contains two functions queryOne and queryAll to be used as custom query handlers The functions queryOne and queryAll are executed in the page context.
DebugInfo Debug information about the browser. Currently includes pending protocol calls. In the future, more info might be added.
DeleteCookiesRequest Request to delete cookies matching specific filters.
DeviceRequestPrompt Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth.
DeviceRequestPromptDevice Device in a request prompt.
DeviceRequestPromptManager Prompt manager.
Dialog Dialog objects are dispatched by page via the ‘dialog’ event.
DialogEventArgs Dialog arguments.
DownloadBehavior Behavior definition for when downloading a file.
DragData Data returned by the drag methods.
DragDataItem Item returned by drag methods.
ElementHandle Inherits from IJSHandle. It represents an in-page DOM element. ElementHandles can be created by QuerySelectorAsync(string) or QuerySelectorAllAsync(string).
ElementScreenshotOptions Options to be used in ElementScreenshotOptions), ScreenshotStreamAsync(ElementScreenshotOptions) and ScreenshotDataAsync(ElementScreenshotOptions).
EmulateIdleOverrides Options for EmulateIdleStateAsync(EmulateIdleOverrides).
EnableExtensionsOption Represents the value for the EnableExtensions launch option. Can be implicitly converted from a bool or a string array.
ErrorEventArgs Error arguments.
EvaluationFailedException Exception thrown by Object).
ExecutionContext The class represents a context for JavaScript execution. Examples of JavaScript contexts are: Each Frame has a separate IExecutionContext All kind of web workers have their own contexts.
Extension Represents an Extension instance installed in the browser.
ExtensionInstallOptions Options for ExtensionInstallOptions).
FileChooser FileChooser objects are returned via the WaitForFileChooserAsync(WaitForOptions) method. File choosers let you react to the page requesting for a file.
FirefoxLauncher Represents a Firefox process and any associated temporary user data directory that have created by Puppeteer and therefore must be cleaned up when no longer needed.
Frame Provides methods to interact with a single page frame in Chromium. One IPage instance might have multiple IFrame instances. At every point of time, page exposes its current frame tree via the MainFrame and ChildFrames properties. IFrame object’s lifecycle is controlled by three events, dispatched on the page object - FrameAttached - fires when the frame gets attached to the page. A Frame can be attached to the page only once - FrameNavigated - fired when the frame commits navigation to a different URL - FrameDetached - fired when the frame gets detached from the page. A Frame can be detached from the page only once.
FrameEventArgs FrameAttached, FrameDetached and FrameNavigated arguments.
FrameNavigatedEventArgs FrameNavigated arguments.
GeolocationOption Geolocation option.
GetContentOptions Options for GetContentAsync(GetContentOptions) and GetContentAsync(GetContentOptions).
GetPWAStateOptions Options for GetPWAStateAsync(GetPWAStateOptions).
HeapSnapshotOptions Options for CaptureHeapSnapshotAsync(HeapSnapshotOptions).
Initiator Information about the request initiator.
InitiatorStackTrace Stack trace information for the Initiator.
InstallPWAOptions Options for InstallPWAAsync(InstallPWAOptions).
InterceptResolutionState Represents the current state of request interception resolution.
Issue Represents a DevTools issue.
IssueEventArgs Issue event arguments.
JSHandle Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Launcher Launcher controls the creation of processes or the connection remote ones.
LauncherBase Represents a Base process and any associated temporary user data directory that have created by Puppeteer and therefore must be cleaned up when no longer needed.
LaunchOptions Options for launching the Chrome/ium browser.
LaunchPWAOptions Options for LaunchPWAAsync(LaunchPWAOptions).
MediaFeatureValue Media Feature. MediaFeatureValue%7d).
MessageEventArgs MessageReceived arguments.
MessageException Exception thrown by. CommandOptions)
MetricEventArgs Metrics arguments.
NavigationException Exception thrown when a IPage fails to navigate an URL.
NavigationOptions Navigation options used by WaitForNavigationAsync(NavigationOptions) and NavigationOptions).
NetworkConditions Options to be used in EmulateNetworkConditionsAsync(NetworkConditions).
NetworkRestrictions Network restrictions that can be applied to a browser at runtime using RestrictNetworkAsync(NetworkRestrictions).
NewDocumentScriptEvaluation New document information.
Page Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
PageCloseOptions Page close options.
PageErrorEventArgs Page error event arguments.
Payload Payload information.
PdfOptions Options to be used in PdfOptions), PdfStreamAsync(PdfOptions) and PdfDataAsync(PdfOptions).
PermissionDescriptor Describes a permission to set via PermissionEntry%5b%5d).
PermissionEntry Represents a permission entry to set via PermissionEntry%5b%5d).
PopupEventArgs Popup event arguments. Popup.
PreconnectedPeripheral A bluetooth peripheral to be simulated.
PredefinedNetworkConditions Predefined network conditions.
ProcessException process exception thrown by Launcher.
Puppeteer Provides a method to launch a Chromium instance.
PuppeteerException Base exception used to identify any exception thrown by PuppeteerSharp.
PuppeteerHandleExtensions IJSHandle and IElementHandle Extensions.
PWAFileHandler A file handler registered by a Progressive Web App (PWA) with the OS.
PWAFileHandlerAccept A media type and its associated file extensions accepted by a PWAFileHandler.
PWAState The OS-integration state of an installed web app, returned by GetPWAStateAsync(GetPWAStateOptions).
QueryOptions Options for query operations like QueryOptions).
Realm Represents an execution context (realm) within a frame or worker.
RecordOptions Options for RecordAsync(RecordOptions).
ReloadOptions Options for ReloadAsync(ReloadOptions).
RemoteAddress Remote server address.
Request<TResponse> Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
RequestEventArgs Arguments used by IPage events.
ResourceTiming Resource timing information as returned by the DevTools Network domain.
Response<TRequest> Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
ResponseCreatedEventArgs Response arguments.
ResponseData Response that will fulfill a request.
ScreencastOptions Options for ScreencastAsync(ScreencastOptions).
ScreenInfo Contains information about a screen.
ScreenOrientationInfo Represents screen orientation information.
ScreenRecorder Represents a screen recording session.
ScreenRecording Represents a video stream-based screen recording session.
ScreenshotOptions Options to be used in ScreenshotOptions), ScreenshotStreamAsync(ScreenshotOptions) and ScreenshotDataAsync(ScreenshotOptions).
SecurityDetails Represents the security details when response was received over the secure connection.
SelectorException Exception thrown when an element selector returns null.
SessionEventArgs Session event arguments.
SetContentOptions Options used by SetContentOptions) and SetContentOptions).
SetUserAgentOptions Options for SetUserAgentAsync(SetUserAgentOptions).
TabInfo Information about the browser tab of a page. See TabInfoAsync().
Target Target.
TargetChangedArgs Event arguments used by target related events.
TargetClosedException Exception thrown by the Connection when it detects that the target was closed.
TargetInfo Target info.
TimeoutSettings Timeout settings.
Tracing You can use StartAsync(TracingOptions) and StopAsync() to create a trace file which can be opened in Chrome DevTools or timeline viewer.
TracingOptions Tracing options used on StartAsync(TracingOptions).
UninstallPWAOptions Options for UninstallPWAAsync(UninstallPWAOptions).
UserAgentBrandVersion Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints.
UserAgentMetadata Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints Missing optional values will be filled in by the target with what it would normally use.
ViewPortOptions View port options used on SetViewportAsync(ViewPortOptions).
WaitForFunctionOptions Optional waiting parameters.
WaitForNetworkIdleOptions Optional waiting parameters.
WaitForOptions Timeout options.
WaitForSelectorOptions Optional waiting parameters.
WaitTaskTimeoutException Timeout exception that might be thrown by WaitFor methods in Frame.
WebWorker The Worker class represents a WebWorker (https://developer.mozilla.org/en-US/docs/Web/API/WebWorkersAPI). The events WorkerCreated and WorkerDestroyed are emitted on the page object to signal the worker lifecycle.
WindowBounds Bounds for a browser window.
WorkAreaInsets Represents work area insets for a screen.
WorkerEventArgs Workder created event arguments.
WsOptions Options for the WebSocket connection to the browser.
Type Summary
Offset Offset used in conjunction with Offset%7d).
Point Represents a Point.
Type Summary
IBluetoothEmulation Exposes the bluetooth emulation abilities.
IBrowser Provides methods to interact with a browser.
IBrowserContext BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single IBrowserContext used by default. The method NewPageAsync(CreatePageOptions) creates a IPage in the default IBrowserContext.
IBrowserFetcher BrowserFetcher can download and manage different versions of Chromium.
IBrowserOptions Browser options.
ICDPConnection An ICDPConnection is an object able to send and receive messages from the browser.
ICDPSession The CDPSession instances are used to talk raw Chrome Devtools Protocol: Protocol methods can be called with CommandOptions) method. Protocol events, using the MessageReceived event. Documentation on DevTools Protocol can be found here: https://chromedevtools.github.io/devtools-protocol/. csharp var client = await Page.Target.CreateCDPSessionAsync(); await client.SendAsync(“Animation.enable”); client.MessageReceived += (sender, e) => { if (e.MessageID == “Animation.animationCreated”) { Console.WriteLine(“Animation created!”); } }; JObject response = await client.SendAsync(“Animation.getPlaybackRate”); Console.WriteLine(“playback rate is “ + response.playbackRate); await client.SendAsync(“Animation.setPlaybackRate”, new { playbackRate = Convert.ToInt32(response.playbackRate / 2) });
IConnectionOptions Options for Connection creation.
IElementHandle Inherits from IJSHandle. It represents an in-page DOM element. ElementHandles can be created by QuerySelectorAsync(string) or QuerySelectorAllAsync(string).
IExecutionContext The class represents a context for JavaScript execution. Examples of JavaScript contexts are: Each Frame has a separate IExecutionContext All kind of web workers have their own contexts.
IFrame Provides methods to interact with a single page frame in Chromium. One IPage instance might have multiple IFrame instances. At every point of time, page exposes its current frame tree via the MainFrame and ChildFrames properties. IFrame object’s lifecycle is controlled by three events, dispatched on the page object - FrameAttached - fires when the frame gets attached to the page. A Frame can be attached to the page only once - FrameNavigated - fired when the frame commits navigation to a different URL - FrameDetached - fired when the frame gets detached from the page. A Frame can be detached from the page only once.
IJSHandle IJSHandle represents an in-page JavaScript object. JSHandles can be created with the EvaluateExpressionHandleAsync(string) and Object%5b%5d) methods.
IPage Provides methods to interact with a single tab in Chromium. One IBrowser instance might have multiple IPage instances.
IPuppeteerUtilWrapper A class that contains a method to get the PuppeteerUtil handle.
IRequest Whenever the page sends a request, the following events are emitted by puppeteer’s page: Request emitted when the request is issued by the page. Response emitted when/if the response is received for the request. RequestFinished emitted when the response body is downloaded and the request is complete. If request fails at some point, then instead of RequestFinished event (and possibly instead of Response event), the RequestFailed event is emitted. If request gets a ‘redirect’ response, the request is successfully finished with the RequestFinished event, and a new request is issued to a redirected url.
IResponse IResponse class represents responses which are received by page.
ITarget Target.
ITracing You can use StartAsync(TracingOptions) and StopAsync() to create a trace file which can be opened in Chrome DevTools or timeline viewer.
IWritableDestination Represents a writable destination for a ScreenRecording.
Type Summary
AdapterState Emulated bluetooth adapter state.
BrowserTag Browser tag.
ConsoleType Console type used on ConsoleMessage.
CookiePriority Represents the cookie’s ‘Priority’ status.
CookieSourceScheme Represents the source scheme of the origin that originally set the cookie. A value of “Unset” allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future.
CreatePageType Specifies the type of page to create.
DialogType Dialog type.
DownloadPolicy Download policy for controlling download behavior.
DragOperation Drag operations available on DragData.
HeadlessMode Headless mode.
InitiatorType Type of the Initiator.
InterceptResolutionAction Represents the action taken for an intercepted request.
MediaFeature Media Feature. See MediaFeatureValue%7d).
OverridePermission Override permission.
PermissionState Permission state for PermissionEntry%5b%5d).
Platform Platform used by a BrowserFetcher.
ProtocolType Protocol used to communicate with the browser.
PWADisplayMode If the user prefers opening an installed web app in a standalone window or in a browser tab.
RequestAbortErrorCode Abort error codes. used by Int32%7d).
ResourceType Resource type.
SameSite SameSite values in cookies.
ScreenshotType Screenshot file type.
SupportedBrowser Supported Browser.
TargetType Target type.
VisionDeficiency Types of vision deficiency to emulate using EmulateVisionDeficiencyAsync(VisionDeficiency).
WaitForFunctionPollingOption An interval at which the pageFunction is executed.
WaitUntilNavigation Wait until navigation.
WindowState Window state for WindowBounds.
Type Summary
BrowserFetcherOptions.CustomFileDownloadAction A custom download delegate.
LazyArg A LazyArg is an evaluation argument that will be resolved when the CDP call is built.

Made with love by Dario Kondratiuk