pip install WeasyPrint
from weasyprint import HTML
HTML('http://arrayoverflow.com/').write_pdf('/tmp/arrayoverflow-website.pdf')
pip install pdfkit
import pdfkit
pdfkit.from_url('http://arrayoverflow.com', 'out.pdf')
pdfkit.from_file('arrayoverflow.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')