From a75f57de4348636ecc28c843d75bbfc455285f5c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 22 Apr 2025 14:33:35 +0200 Subject: [PATCH] Browser Steps - by option text': '1 1', 'Scroll down': '0 0', 'Uncheck checkbox': '1 0', 'Wait for seconds': '0 1', @@ -228,6 +229,15 @@ class steppable_browser_interface(): except Exception as e: logger.error(f"Error parsing x,y coordinates: {str(e)}") + def action__select_by_option_text(self, selector, value): + if not selector or not len(selector.strip()): + return + + def select_operation(): + self.page.select_option(selector, label=value, timeout=self.action_timeout) + + self.safe_page_operation(select_operation) + def action_scroll_down(self, selector, value): def scroll_operation(): # Some sites this doesnt work on for some reason diff --git a/changedetectionio/static/js/browser-steps.js b/changedetectionio/static/js/browser-steps.js index da130959..8b069005 100644 --- a/changedetectionio/static/js/browser-steps.js +++ b/changedetectionio/static/js/browser-steps.js @@ -211,7 +211,14 @@ $(document).ready(function () { $('input[type=text]', first_available).first().val(x['xpath']); $('input[placeholder="Value"]', first_available).addClass('ok').click().focus(); found_something = true; - } else { + } + else if (x['tagName'] === 'select') { + $('select', first_available).val('