This package is used to Clipped Images of Html Elements of Selenium Webdriver
Project description
Selenium Screenshot:
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 Screenshot import Screenshot
from selenium import webdriver
ob = Screenshot.Screenshot()
driver = webdriver.Chrome()
url = "https://github.com/sam4u3/Selenium_Screenshot/tree/master/test"
driver.get(url)
img_url = ob.full_screenshot(driver, save_path=r'.', image_name='myimage.png', is_load_at_runtime=True,
load_wait_time=3)
print(img_url)
driver.close()
driver.quit()
For Html Element Clipping:
from Screenshot import Screenshot
from selenium import webdriver
from selenium.webdriver.common.by import By
ob = Screenshot.Screenshot()
driver = webdriver.Chrome()
url = "https://github.com/sam4u3/Selenium_Screenshot/blob/master/Screenshot/Screenshot_Clipping.py"
driver.get(url)
element = driver.find_element(By.XPATH, "//img[@title='Donate via PayPal']")
img_url = ob.get_element(driver, element, save_path=r'.', image_name='paypal.png')
print(img_url)
driver.close()
driver.quit()
For Html Element Clipping with Hiding Element:
from Screenshot import Screenshot
from selenium import webdriver
ob = Screenshot.Screenshot()
driver = webdriver.Chrome()
url = "https://github.com/sam4u3"
driver.get(url)
hide_elements = ['class=position-relative js-header-wrapper ']
img_url = ob.full_screenshot(driver, save_path=r'.', image_name='myimage.png',
hide_elements=hide_elements)
print(img_url)
driver.close()
driver.quit()
Limitation:
- Screenshot can take only 10000 of height of website
Contact Information:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Selenium-Screenshot-2.1.0.tar.gz
.
File metadata
- Download URL: Selenium-Screenshot-2.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c733fab6a3ba205b17ceee01c65419db677be4ac46827503b1dcace521b1197 |
|
MD5 | d8d07eb00808cfe9d3b9ddede40c2793 |
|
BLAKE2b-256 | 617a4c7746b687e07adba89262956996dc5b355ae0fcab6572b660697a139a0b |