1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Take screenshot of whole html-page using python with selenium in non-headless mode?

Discussão em 'Python' iniciado por Stack, Dezembro 1, 2025.

  1. Stack

    Stack Membro Participativo

    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

    [​IMG]

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

    Continue reading...

Compartilhe esta Página