Answer the question
In order to leave comments, you need to log in
Python - how to save a web page (Telegraph article) to PDF?
You need to save the web page, in this case the Telegraph article.
When I try
import pdfkit
pdfkit.from_url("https://telegra.ph/Statya-obrazec-08-26", "out.pdf")
from weasyprint import HTML
pdf = HTML('https://telegra.ph/Statya-obrazec-08-26').write_pdf()
f = open('out.pdf', 'wb')
f.write(pdf)
f.close()
Answer the question
In order to leave comments, you need to log in
Completely working solution. Works on the server too. https://wkhtmltopdf.org/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question