From a7afcb4b30a4ab63f33cf0cb07b05378ffa16a5a Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Sat, 13 May 2023 18:27:28 +0200 Subject: [PATCH] Add files via upload --- content/press_sourcecode_button.json | 3 ++- content/press_sourcecode_button.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/content/press_sourcecode_button.json b/content/press_sourcecode_button.json index 0ff4979..a7fb4bf 100644 --- a/content/press_sourcecode_button.json +++ b/content/press_sourcecode_button.json @@ -1,3 +1,4 @@ { - "lable_for_source_code_button": "Quellcode" + "lable_for_source_code_button": "Quellcode", + "end_state_button_class": "cke_button_on" } \ No newline at end of file diff --git a/content/press_sourcecode_button.py b/content/press_sourcecode_button.py index f46dc26..140aa19 100644 --- a/content/press_sourcecode_button.py +++ b/content/press_sourcecode_button.py @@ -15,5 +15,11 @@ def press_sourcecode_button(driver: webdriver.firefox.webdriver.WebDriver): for i in found_element_list: temp_str = str(i.get_dom_attribute("title")) if temp_str.find(string_dict["lable_for_source_code_button"]) != -1: - i.click() + while ( + str(i.get_dom_attribute("class")).find( + string_dict["end_state_button_class"] + ) + == -1 + ): + i.click() break