Take a screenshot of open website in python script

后端 未结 3 740

I need to write a python script which opens a website and when the website is completly opened it takes a screenshot of the opened website.

I wrote sth like this:

3条回答
  •  悲哀的现实
    2020-12-21 16:54

    I believe that you need different solutions for different operating systems. Use sys.platform to find out on which platform you are on. The rest you have to figure out yourself, but a quick internet search revealed:

    • On Linux systems, you can then take a screenshot as described here:

    Take a screenshot via a python script. [Linux]

    • On Windows systems, you can base your solution on this answer:

    Fastest way to take a screenshot with python on windows

    • On Mac systems, this will help:

    Take screenshot in Python on Mac OS X

提交回复
热议问题