Screenshot html

How do I create a screenshot of an html source?
like this: https://i.imgur.com/Ct492gU.png

Use selenium and screenshot the page