Save piece of HTML as image

I like to render a piece of HTML in a string to an image and save this image.

One could adress this challenge by using pillow, selenium and maybe webdriver-manager.

Does anyone have some experience with realizing such an approach/functionality in Streamlit?