Skip to content

Commit bb3053b

Browse files
authored
[py] Added Deprecation of WebElement.get_attribute() per #13334 (#14675)
1 parent f56b3d0 commit bb3053b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

py/selenium/webdriver/remote/webelement.py

+7
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ def get_attribute(self, name) -> str | None:
173173
# Check if the "active" CSS class is applied to an element.
174174
is_active = "active" in target_element.get_attribute("class")
175175
"""
176+
177+
warnings.warn(
178+
"using WebElement.get_attribute() has been deprecated. Please use get_dom_attribute() instead.",
179+
DeprecationWarning,
180+
stacklevel=2,
181+
)
182+
176183
if getAttribute_js is None:
177184
_load_js()
178185
attribute_value = self.parent.execute_script(

0 commit comments

Comments
 (0)