|
|
|
|
|
by konschubert
991 days ago
|
|
> If you can provide a script that takes in an HTML file and provides an image ready for rendering, that would be amazing. Yea, that's something I have been trying to build, but it's surprisingly non-trivial. There are a bunch of headless browser options, but I haven't found a good way to tell them: "Render the page in X width and Y height and then take a screenshot". That seems like a problem that should have 100 open source solutions for it, and I am sure there are some that work really well! But I personally haven't found one yet. |
|
Isn't this the exact example of phantomjs?
``` page.viewportSize = { width: 600, height: 600 }; ```
At least that is what I use to do for screen testing for some of our low-hanging-fruit QA. At some point I rewrote it in puppeteer and it was as simple as the above line.
The screenshot results in being the X/Y size.
I'd be interested in why this doesn't work in your usecase.