0

i try 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 wold 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?

asked 4 hours ago
6
  • 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 4 hours ago
  • stackoverflow.com/questions/41721734/… Commented 4 hours ago
  • stackoverflow.com/a/53825388/15358800 Commented 4 hours ago
  • 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 4 hours ago
  • 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 3 hours ago

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.