pyhtmlconv: html converter (image / pdf)
Project description
pyhtmlconv: html converter (image / pdf)
python html converter (image / pdf)
Installation
Anda perlu menginstall wkhtmltopdf, sebelum menginstall modul ini.
pip install pyhtmlconv
Example
import pyhtmlconv as html
url = "https://google.com"
image = html.convert_to_image(url, "jpeg")
with open("test_image.jpeg", "wb") as fp:
fp.write(image)
pdf = html.convert_to_pdf(url)
with open("test_file.pdf") as fp:
fp.write(pdf)
Anda juga dapat mengkonversikan data (image atau pdf) ke bentuk data uri dengan cara menambahkan nilai True pada parameter datauri di fungsi convert_to_image atau convert_to_pdf.
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
pyhtmlconv-1.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for pyhtmlconv-1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aed1c7598e9d705e09eba41762a32191863c1f743ef86aa0afb0063904bd8af |
|
MD5 | 74e173af11276d20b06fa7938ca290fe |
|
BLAKE2b-256 | ce9ec78ddcac44925a779fb95bfd12241082e6e95abe572dbbf9cfca53c08aea |