pip install WeasyPrint
from weasyprint import HTML
HTML('http://arrayoverflow.com/').write_pdf('/tmp/arrayoverflow-website.pdf')
from pdfrw import PdfWriter
y = PdfWriter()
y.addpage(x.pages[0])
y.write('result.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')