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.1.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for pyhtmlconv-1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ca5ff953e0d23e39cb4d044f486f3ea5193fe304a45d6455cac50903d1d6cf |
|
MD5 | 0fde7cfd0b5a1d0d225f6ca809b3ba99 |
|
BLAKE2b-256 | b09a5ec48142912ada888457c6e5e171b6cf92245ead9e9585c9eec62e0d5321 |