zuschneiden der Screenshots implementiert.

This commit is contained in:
romanschenk37 2022-03-11 20:44:21 +01:00
parent f8382284f8
commit ccd2c49e39
1 changed files with 14 additions and 13 deletions

27
Main.py
View File

@ -26,6 +26,7 @@ outputtext = "Welcome to application Sonnendach\n"
columnIndexes = [] columnIndexes = []
def search_adresses(adress_list, filename_adresslist, driver): def search_adresses(adress_list, filename_adresslist, driver):
global file_split_char global file_split_char
global stopThread global stopThread
@ -75,20 +76,20 @@ def search_adresses(adress_list, filename_adresslist, driver):
adress_file.write(new_adress_list) adress_file.write(new_adress_list)
adress_file.close() adress_file.close()
featureElement = driver.find_element(By.XPATH,
"//section[@id='one']//div[@class='container']//div[@class='row 150%']")
#featureElement = driver.find_element(By.XPATH, "// section[contains(string(),START SCREENSHOT TESTING)]") location = featureElement.location
#location = featureElement.location size = featureElement.size
#size = featureElement.size
driver.save_screenshot(image_filename) driver.save_screenshot(image_filename)
#x = location["x"] x = location["x"]
#y = location["y"] y = 0 # location["y"]
#w = x + size["width"] w = x + size["width"]
#h = y + size["height"] h = y + size["height"] - 100
#fullImg = Image.open(image_filename) area = (x, y, w, h)
#cropImg = fullImg.crop(x, y, w, h) print(area)
#cropImg.save(image_filename) fullImg = Image.open(image_filename)
# TODO Screenshot schneiden cropImg = fullImg.crop(area)
cropImg.save(image_filename)
print(image_filename + " was saved.") print(image_filename + " was saved.")