1

I am in development of an application within Flask. There is a webpage within the application for which I want to have a button that takes a screenshot of the page. I have been messing around with some libraries and packages but one of the main issues is that I will not know the screen resolution of the screen that currently has the page displayed.
For example, someone who has two monitors could have the screen displayed on their main or their second, but one of the libraries that I was using to screenshot the page would always screenshot the main monitor.
Another issue is that where the application is being stored does not allow for mouse or keyboard monitoring. For example, one library had exactly what I needed, but I cannot use it due to the library having a GUI that took interaction from the user.

I am looking for a clean and easy way to have a button that when clicked would either take a screenshot of the whole webpage or convert the HTML webpage into a jpeg.

Sebasi
  • 11
  • 2
  • I think trying to do it within Flask is leading you astray. Use JS in the browser and send the result. [This question](https://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-in-browser-screenshots/6678156#6678156) may help. –  Aug 02 '20 at 16:54
  • You'll need to use a headless browser, like Puppeteer. – D. Pardal Aug 02 '20 at 17:06

0 Answers0