Skip to content

[BUG] page.screenshot(full_page=True) crops way too little & loses area #726

@ivarsj10s

Description

@ivarsj10s

Preword

Hi, Playwright Python! I have a new bug, a new tech issue; details below:

The problem

I'm getting way too little "full_screenshot" out of my full screenshot command. Instead of getting the whole "full_screenshot" area I want to have, the command saves both too little height and too little width. The image is unnecessarily cropped too short in both height and width.

Source code & illustrative image

Source code:

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    ctx = p.chromium.launch(headless=False)
    page = ctx.new_page()
    page.goto("https://en.wikipedia.org/wiki/Hundred_Years%27_War")
    page.screenshot(path="scs.png", full_page=True)
    ctx.close()

Illustrative image:

https://imgur.com/a/F3vocO0

Secondary questions

  1. If it's caused by my system's scale factor, can I offset it some way purely using Python code for Playwright-Python rather than via resetting my scale factor?

OS / setup / notes

  • Windows 10
  • I have scale factor 1.5x on my Windows 10 system to accomodate my 4k display

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions