kopia lustrzana https://github.com/dgtlmoon/changedetection.io
rodzic
72a1c3dda1
commit
a75f57de43
|
@ -37,6 +37,7 @@ browser_step_ui_config = {'Choose one': '0 0',
|
||||||
'Make all child elements visible': '1 0',
|
'Make all child elements visible': '1 0',
|
||||||
'Press Enter': '0 0',
|
'Press Enter': '0 0',
|
||||||
'Select by label': '1 1',
|
'Select by label': '1 1',
|
||||||
|
'<select> by option text': '1 1',
|
||||||
'Scroll down': '0 0',
|
'Scroll down': '0 0',
|
||||||
'Uncheck checkbox': '1 0',
|
'Uncheck checkbox': '1 0',
|
||||||
'Wait for seconds': '0 1',
|
'Wait for seconds': '0 1',
|
||||||
|
@ -228,6 +229,15 @@ class steppable_browser_interface():
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error parsing x,y coordinates: {str(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 action_scroll_down(self, selector, value):
|
||||||
def scroll_operation():
|
def scroll_operation():
|
||||||
# Some sites this doesnt work on for some reason
|
# Some sites this doesnt work on for some reason
|
||||||
|
|
|
@ -211,7 +211,14 @@ $(document).ready(function () {
|
||||||
$('input[type=text]', first_available).first().val(x['xpath']);
|
$('input[type=text]', first_available).first().val(x['xpath']);
|
||||||
$('input[placeholder="Value"]', first_available).addClass('ok').click().focus();
|
$('input[placeholder="Value"]', first_available).addClass('ok').click().focus();
|
||||||
found_something = true;
|
found_something = true;
|
||||||
} else {
|
}
|
||||||
|
else if (x['tagName'] === 'select') {
|
||||||
|
$('select', first_available).val('<select> by option text').change();
|
||||||
|
$('input[type=text]', first_available).first().val(x['xpath']);
|
||||||
|
$('input[placeholder="Value"]', first_available).addClass('ok').click().focus();
|
||||||
|
found_something = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
// There's no good way (that I know) to find if this
|
// There's no good way (that I know) to find if this
|
||||||
// see https://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node-in-javascript-or-in-debugging
|
// see https://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node-in-javascript-or-in-debugging
|
||||||
// https://codepen.io/azaslavsky/pen/DEJVWv
|
// https://codepen.io/azaslavsky/pen/DEJVWv
|
||||||
|
|
Ładowanie…
Reference in New Issue