Home > Software engineering >  Selenium does not take the screenshot of the whole website, when its not headless
Selenium does not take the screenshot of the whole website, when its not headless

Time:09-25

Disclaimer: I know, that there is a similar question already, but none of the answers works for headless browser, so I have decided to make 1 more and a bit more detailed one (the question I have mentioned: With headless option

Without headless option

Without headless option

CodePudding user response:

You can use Screenshot_Clipping in order to scroll the page and take screenshot from each scroll.

Just run this command in python3

pip install Selenium-Screenshot

Then create an object of Screenshot:

ob=Screenshot_Clipping.Screenshot()

With that object you can use ob.full_Screenshot in order to capture full screen

Checkout PythonFullPageScreenShot project on Github for full source code

Note that screenshot can take only 10000 of height of website, You can scale to 100 in order to capture full height

  • Related