Skip to content

Instantly share code, notes, and snippets.

@matheuscdo
matheuscdo / highlight_sel_element.py
Created October 19, 2022 17:11 — forked from dariodiaz/highlight_sel_element.py
python: Highlights a Selenium Webdriver element
import time
def highlight(element):
"""Highlights (blinks) a Selenium Webdriver element"""
driver = element._parent
def apply_style(s):
driver.execute_script("arguments[0].setAttribute('style', arguments[1]);",
element, s)
original_style = element.get_attribute('style')
apply_style("background: yellow; border: 2px solid red;")