I am using selenium/phantomjs to create png files of html in python. Is there a way to generate the png from an html string or filehandle (instead of a website)? I\'ve searc
It seems the lines
f = open(myFile,'w') f.write(htmlString)
Are problematic, as the generated file is empty.
I fixed this issue with
with open(myFile,'wt') as f: f.write(htmlString)
or you might have to add a
f.close() to your code