screenshot
Captures a screenshot of the page. Appends timeStamp to filename if no filepath given.
Examples
await screenshot()
await screenshot({path : 'screenshot.png'})
await screenshot({fullPage:true})
await screenshot(text('Images', toRightOf('gmail')))
Parameters
-
selector
-
options
-
options.fullpageboolean -
toggles full page screenshot
- Default value
-
false
-
options.pathstring -
path of the output file
- Default value
-
'Screenshot-${Date.now()}.png'
-
options.encodingstring -
encoding for the image
- Default value
-
'base64'
Returns
Promise which resolves to buffer with captured screenshot if {encoding:'base64'} given, otherwise it resolves to undefined.