-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Screenshot of a portion of a page does not clip correctly #12042
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This bug requires that the server be run in order to view the output manually: https://github.com/baggachipz/puppeteer-screenshot-bug |
@baggachipz could you please specify which version worked as expected? I have tried with v19 and the clip is not working there as well, it's clipping relative to the page instead of the element handle. |
Or is it expected that it clips relative the page, instead of the relative to the element handle screenshot? 🤔 Looks like there is no test coverage for this case either. |
In v20.8.2, it clipped relative to the element handle. That's what I expect as the result. in the |
It does not seem to work in 20.8.2 as well (same behavior as |
Very strange; In the main project I work on, it used |
Minimal, reproducible example
Error string
no error
Bug behavior
Background
When selecting an element in a Page (
page.$("selector")
, and then creating a screenshot with aScreenshotClip
property, the screenshot fails to clip and screenshots the whole portion of the selector. This functionality worked correctly in v20 and earlier, and is broken in the latest version (v22.3).Expectation
A partial screenshot as defined by the
clip
property.Reality
Full screenshot of the page element regardless of the clip parameter.
Full example available at https://github.com/baggachipz/puppeteer-screenshot-bug
Puppeteer configuration file (if used)
No response
Puppeteer version
22.3
Node version
21.6.2
Package manager
npm
Package manager version
10.2.4
Operating system
macOS
The text was updated successfully, but these errors were encountered: