Skip to content

PyWizards/Selenium_Screenshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forthebadge made-with-python

Selenium Screenshot:

Open Source Love svg1 License: MIT Downloads Python 3.6 PyPI version Python package

The Selenium Screenshot is used to clip Html pages and elements using Selenium.

Installation:

pip install Selenium-Screenshot

This package supports Python 3.6+ only.

How to Use:

For Full Page Screenshot:

from selenium import webdriver
from Screenshot import Screenshot

driver = webdriver.Chrome()
driver.get("https://en.wikipedia.org/wiki/Python")

ss = Screenshot(driver)

# Example: hide sticky header + specific table
table_to_hide = driver.find_element("css selector", "#p-search")

ss.capture_full_page(
    output_path="python_wiki.png",
    hide_selectors=[".vector-sticky-header", "#mw-head", table_to_hide]  # mix of CSS + WebElement
)

driver.quit()

For Html Element Clipping:

from selenium import webdriver
from Screenshot import Screenshot

driver = webdriver.Chrome()
driver.get("https://en.wikipedia.org/wiki/Python")

ss = Screenshot(driver)

# Capture a specific box (e.g., infobox)
content_only = driver.find_element("css selector", "#mw-content-text")
ss.capture_element(content_only, "content_only.png")

driver.quit()

Contact Information:

Email:py.wizard.org@gmail.com

Donation:

If you have found my software to be of any use to you, do consider helping me pay my internet bills. This would encourage me to maintain and create more projects.

Donate via PayPal

About

This package is used to Clipped Images of Html Elements of Selenium Webdriver

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 11

Languages