Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make a screenshot of any webpage using Python, Selenium and Chrome
# 1) pip install selenium
# 2) ChromeDriver: http://chromedriver.chromium.org/downloads
from selenium import webdriver
DRIVER = 'chromedriver'
driver = webdriver.Chrome(DRIVER)
driver.get('https://erugame.ru/') # какой сайт
driver.save_screenshot("screenshot.png")
# если надо скриншот страницы целиком с прокруткой до низа:
element = driver.find_element_by_tag_name('body')
element.screenshot("screenshot_full.png")
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.