Archive | October, 2017

PhantomJS alternative: Write short PyQt scripts instead (phantom.py)

For a project of mine, I needed a ‘headless’ script that renders dynamically generated HTML (via JavaScript) to a PDF file. In looking for existing headless browsers, I found PhantomJS, CasperJS and similar projects. PhantomJS looked most promising, but it had bugs related to the CSS @media type ‘print’ which made the project useless for […]

Continue Reading 0

phantom.py: A lean replacement for bulky headless browser frameworks

This is a simple but fully scriptable headless QtWebKit browser using PyQt5 in Python3, specialized in executing external JavaScript and generating PDF files. A lean replacement for other bulky headless browser frameworks. (Source code at end of this post as well as in this github gist) Usage If you have a display attached:

If […]

Continue Reading 2

Powered by WordPress. Designed by Woo Themes