(no title)
avivo
|
2 years ago
If you can provide a script that takes in an HTML file and provides an image ready for rendering, that would be amazing. Then I can automatically take any website and have a cron job that dumps the result into a shared dropbox link where it can be used by the screen.
konschubert|2 years ago
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.
ticoombs|2 years ago
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.
simonbw|2 years ago
Headless Chrome seems like it should be able to do what you want pretty easily. https://developer.chrome.com/blog/headless-chrome/
IanCal|2 years ago
mlunar|2 years ago
Hopefully you find it useful :)