From bcc6ae6e8f249db0a0057bae36f8f77c53901c6b Mon Sep 17 00:00:00 2001 From: Nabil Elqatib Date: Tue, 16 Jun 2020 15:05:28 +0200 Subject: [PATCH] Add an optional parameter to hide elements from get_elements function --- Screenshot/Screenshot_Clipping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Screenshot/Screenshot_Clipping.py b/Screenshot/Screenshot_Clipping.py index 6b92f2d..c3ff006 100644 --- a/Screenshot/Screenshot_Clipping.py +++ b/Screenshot/Screenshot_Clipping.py @@ -116,7 +116,7 @@ def full_Screenshot(self, driver: WebDriver, save_path: str = '', image_name: st stitched_image.save(save_path) return save_path - def get_element(self, driver: WebDriver, element: WebElement, save_location: str) -> str: + def get_element(self, driver: WebDriver, element: WebElement, save_location: str, to_hide: list = None) -> str: """ Usage: Capture Element screenshot as a image @@ -129,7 +129,7 @@ def get_element(self, driver: WebDriver, element: WebElement, save_location: str Raises: N/A """ - image = self.full_Screenshot(driver, save_path=save_location, image_name='clipping_shot.png') + image = self.full_Screenshot(driver, save_path=save_location, image_name='clipping_shot.png', elements=to_hide) location = element.location size = element.size x = location['x']