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