From 34c3023cf95dc3d6109c41900e9b9b2576680f3a Mon Sep 17 00:00:00 2001 From: romanschenk37 <84532681+romanschenk37@users.noreply.github.com> Date: Sun, 13 Mar 2022 17:14:09 +0100 Subject: [PATCH] Zuschneiden der Screenshots angepasst. --- Main.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Main.py b/Main.py index 25d6022..a301bdc 100644 --- a/Main.py +++ b/Main.py @@ -100,14 +100,18 @@ def search_adresses(adress_list, filename_adresslist, driver): qr.make(fit=True) qr.make_image(fill='black', back_color='white').save("qrcodes/" + image_filename) - #Create Screenshot - featureElement = driver.find_element(By.XPATH, "//section[@id='one']//div[@class='container']//div[@class='row 150%']") - location = featureElement.location - size = featureElement.size + # Create Screenshot + featureElement1 = driver.find_element(By.XPATH, + "//section[@id='one']//div[@class='container']//div[@class='row 150%']") + featureElement2 = driver.find_element(By.XPATH, + "//section[@id='one']") + location = featureElement1.location + size1 = featureElement1.size + size2 = featureElement2.size x = location["x"] - y = 0 # location["y"] - w = x + size["width"] - h = y + size["height"] - 100 + y = 5 # location["y"] + w = x + size2["width"] + h = y + size1["height"] area = (x, y, w, h) time.sleep(1) driver.save_screenshot("screenshots/" + image_filename)