1

I am trying to take a full screenshot of the whole html-page using the following code -

  • I would like to do this with selenium (not pyppeteer)
  • I am searching for a python solution (not Java)
  • I am searching for a non-headless solution (not headless)
  • I would like to do this with selenium (not seleniumbase)

Code:

import time from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By options = Options() srv=Service() driver = webdriver.Chrome (service=srv, options=options) driver.maximize_window() link = "https://rapidtech1898.com/" driver.get (link) time.sleep(3) el = driver.find_element(By.XPATH,'(//body)[1]') el.screenshot("test.png") driver.quit() 

But it is only taking the first part of the page and not the whole website till the bottom

enter image description here

How can I get the full html-site as a screenshot in non-headless mode?

7
  • This question is similar to: How to get screenshot of full webpage using Selenium and Java?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Nov 19 at 10:39
  • stackoverflow.com/questions/41721734/… Commented Nov 19 at 10:40
  • stackoverflow.com/a/53825388/15358800 Commented Nov 19 at 10:42
  • This question is similar to: Take screenshot of full page with Selenium Python with chromedriver. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Nov 19 at 10:42
  • Thanks for the link - but i am searching for another solution - - i am not searching for java - for python - and i am not searching for headless-mode - for non-headless mode (everything is stated in my initial question i would say - when i understand it correct your links are refreing to either a java-solution or a headless-solution) Commented Nov 19 at 11:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.