HTML to IMAGE using Python

You can do this by using imgkit import imgkit imgkit.from_file(‘test.html’, ‘out.jpg’) Or you can also use htmlcsstoimage Api # pip3 install requests import requests HCTI_API_ENDPOINT = “https://hcti.io/v1/image” HCTI_API_USER_ID = ‘your-user-id’ HCTI_API_KEY = ‘your-api-key’ data = { ‘html’: “<div class=”box”>Hello, world!</div>”, ‘css’: “.box { color: white; background-color: #0f79b9; padding: 10px; font-family: Roboto }”, ‘google_fonts’: “Roboto” } … Read more