Forums

wkhtmltoimage

Hello. I dont know why but seems like the wkhtmltoimage on pythonanywhere has some issues dealing with https scripts and images which is really weird as I have the same version in my computer 0.12.5 and it runs fine for me, I am trying to take a screenshot of widget, which obviously requires javascript, I put the html code in a local file and it fetches a distant SSL based connection for the javascript and that makes it show the following error:

Warning: Failed to load https://widgets.somesite.com/widget.js (ignore)

it ignores it and generates a blank image with the size 0x0 been looking inside of github issues and none helped, I guess a clean reinstall of the wkhtmltoimage program will solve the issue, maybe it is damaged, or maybe the network in pythonanywhere has issues with https sites. I could do nothing from my side as I can't use sudo apt-get install. However I tried to use some packages like imgkit that are based on wkhtmltoimage and need wkhtmltoimage program to work and hence, it sadly gives the same result...

Please can you solve this issue ASAP. It is one useful tool to have in pythonanywhere.

Thanks and best regards.

Free accounts on PythonAnywhere have restricted internet access to whitelisted domains, that's the most probable cause of the error you get.

Well, that could be possible but I dont really think so. Because after taking a screenshot of google's homepage in both my computer and pythonanywhere, I got the most recent styling, theme and view of Google while on Pythonanywhere it showed an older version of Google styling, and view. I believe ES6 (js) not supported in the browser used with Pythonanywhere. Is it possible to update it? I know that wkhtmltoimage/wkhtmltopdf is based on webkit, so webkit browser should be updated. PS. I have the same version of wkhtmltopdf as the one in pythonanywhere.

Chromium installed on PythonAnywhere is version 90 and ES6 is supported since version 51