kopia lustrzana https://github.com/dgtlmoon/changedetection.io
Browser Steps - Added new "Remove elements" action
rodzic
5e7c0880c1
commit
7903b03a0c
|
@ -38,6 +38,7 @@ browser_step_ui_config = {'Choose one': '0 0',
|
||||||
'Wait for seconds': '0 1',
|
'Wait for seconds': '0 1',
|
||||||
'Wait for text': '0 1',
|
'Wait for text': '0 1',
|
||||||
'Wait for text in element': '1 1',
|
'Wait for text in element': '1 1',
|
||||||
|
'Remove elements': '1 0',
|
||||||
# 'Press Page Down': '0 0',
|
# 'Press Page Down': '0 0',
|
||||||
# 'Press Page Up': '0 0',
|
# 'Press Page Up': '0 0',
|
||||||
# weird bug, come back to it later
|
# weird bug, come back to it later
|
||||||
|
@ -192,6 +193,10 @@ class steppable_browser_interface():
|
||||||
def action_uncheck_checkbox(self, selector, value):
|
def action_uncheck_checkbox(self, selector, value):
|
||||||
self.page.locator(selector).uncheck(timeout=self.action_timeout)
|
self.page.locator(selector).uncheck(timeout=self.action_timeout)
|
||||||
|
|
||||||
|
def action_remove_elements(self, selector, value):
|
||||||
|
"""Removes all elements matching the given selector from the DOM."""
|
||||||
|
self.page.locator(selector).evaluate_all("els => els.forEach(el => el.remove())")
|
||||||
|
|
||||||
|
|
||||||
# Responsible for maintaining a live 'context' with the chrome CDP
|
# Responsible for maintaining a live 'context' with the chrome CDP
|
||||||
# @todo - how long do contexts live for anyway?
|
# @todo - how long do contexts live for anyway?
|
||||||
|
|
Ładowanie…
Reference in New Issue