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.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for pyhtmlconv-1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 925fbc94854d4d9f07028267f10b2d56548adda6c56a1d78870d406d0e84ead2 |
|
MD5 | 6cf15cfa7d536d7224c8c12b71af7b6d |
|
BLAKE2b-256 | acb2e7c1ecf66550263328a1205e2897fe18e6afb2efc4b888b13f82f4ff301c |