Back
I am trying to convert the webpage into PDF by using Python but I am getting one error message:
'ImportError: No module named PyQt4.QtCore', and 'ImportError: No module named PyQt4.QtCore'.
You have to use the pdfkit package from Python:
import pdfkitpdfkit.from_url('http://google.com', 'out.pdf')
import pdfkit
pdfkit.from_url('http://google.com', 'out.pdf')
Below are the installation codes for the different os:
macOS: brew install Caskroom/cask/wkhtmltopdfDebian/Ubuntu: apt-get install wkhtmltopdfWindows: choco install wkhtmltopdf
macOS: brew install Caskroom/cask/wkhtmltopdf
Debian/Ubuntu: apt-get install wkhtmltopdf
Windows: choco install wkhtmltopdf
31k questions
32.8k answers
501 comments
693 users