mkbabb / selenium-to-pdf

Given an HTML document, converts thereupon to a PDF using Selenium's DevTools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

selenium-to-pdf

Given an HTML document, converts thereupon to a PDF using Selenium's DevTools.

Requires selenium and ChromeDriver. For more information on how to install ChromeDriver, see here.

Example

from selenium_to_pdf import convert

url = "https://www.fulltextarchive.com/book/dante-s-inferno/#CANTO-1-2"

pdf_data = convert.html_to_pdf(url=url)

with open("dante.pdf", "wb") as f:
    f.write(pdf_data)

About

Given an HTML document, converts thereupon to a PDF using Selenium's DevTools.

License:The Unlicense


Languages

Language:Python 100.0%