diff --git a/Screenshot/Screenshot_Clipping.py b/Screenshot/Screenshot_Clipping.py index 2985e20..fb0422e 100644 --- a/Screenshot/Screenshot_Clipping.py +++ b/Screenshot/Screenshot_Clipping.py @@ -118,7 +118,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, to_hide: list = None) -> str: + def get_element(self, driver: WebDriver, element: WebElement, save_location: str, image_name : str = 'cropped_screenshot.png', to_hide: list = None) -> str: """ Usage: Capture Element screenshot as a image @@ -143,8 +143,7 @@ def get_element(self, driver: WebDriver, element: WebElement, save_location: str image_object = Image.open(image) image_object = image_object.crop((int(x), int(y), int(width), int(height))) - uid = str(uuid.uuid4()) - img_url = os.path.abspath(os.path.join(save_location, f"{uid}.png")) + img_url = os.path.abspath(os.path.join(save_location, f"{image_name}.png")) image_object.save(img_url) return img_url