Skip to content

Screenshot

By default, all screenshot methods save the files in the current active directory.

Accessing the object

1
2
3
app = FastRPA()
web = app.browse('https:...')
type(web.screenshot)
Output
fastrpa.core.screenshot.Screenshot

Reference

Get a PNG bytes content from the current viewport size

web.screenshot.image
Output
b'\x89PNG\r\n\x1a\n\x00\x00...'

Save a PNG file from the current viewport size

To just save on the current workdir.

web.screenshot.save_image()

Or, if needed, specify the path.

web.screenshot.save_image('/my/screenshot/path.png')

Viewport screenshot example

image

Get a PNG bytes content from the complete page

web.screenshot.full_page_image
Output
b'\x89PNG\r\n\x1a\n\x00\x00...'

Save a PNG file from the complete page

To just save on the current workdir.

web.screenshot.save_full_page()

Or, if needed, specify the path.

web.screenshot.save_full_page('/my/screenshot/path.png')

Full page screenshot example

image