How do I use python-webkit2png to take many screenshots at the same time?

oldfellow picture oldfellow · Apr 30, 2010 · Viewed 9.5k times · Source

I've got thousands of urls from many hosts I need to screenshot.

I can use the lib fine from the command line, but how can I integrate it into my code so I can take multiple screenshots simultaneously?

I think it's something to do with xvfb as with the answer to this question: How to kill headless X server started via Python? but I'm not sure what exactly.

Answer

ass-king some question picture ass-king some question · Mar 21, 2018

here I have used an argument to pass a location of .txt, which contains a list of site(newline delimited), and the second argument for the location of output PNG file.

https://gist.github.com/deadstar1/e8d30102afbaefec531d6708f761e104 thanks to @paljenczy