Skip to main content

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

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selenium_to_pdf-0.3.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

selenium_to_pdf-0.3.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page