vgalin / html2image

A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.
MIT License
344 stars 44 forks source link

For some reason this package spammed my output. I added 2 lines so it doesn't anymore. #54

Closed thorvalddox closed 2 years ago

vgalin commented 2 years ago

Hello, thank you for opening a pull request.

I think this could be improved a little bit. First of all, while you may not need the lines outputted by Chrome/Chromium, these messages could be hinting what is happening if something went wrong during the execution of Chromium headless. To be able to disable them when everything is working properly would be nice, but they should probably be enabled by default.

To make it short, here is what is missing:

On a side note, I would probably use

subprocess.run(..., stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

instead of relying on a file object returned by open.

If you're willing to do the changes yourself, feel free to do so. If not, no problem, I (or someone else, we never know) will take care of it.

I will also open an issue related to this, feel free to discuss possible changes here when it will be opened.