We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdf8975 commit b448f83Copy full SHA for b448f83
py/selenium/webdriver/remote/webelement.py
@@ -37,6 +37,8 @@
37
except ImportError: # 3+
38
from io import BytesIO as IOStream
39
40
+getAttribute_js = pkgutil.get_data(__package__, 'getAttribute.js').decode('utf8')
41
+
42
43
class WebElement(object):
44
"""Represents a DOM element.
@@ -131,9 +133,8 @@ def get_attribute(self, name):
131
133
132
134
attributeValue = ''
135
if self._w3c:
- raw = pkgutil.get_data(__package__, 'getAttribute.js')
136
attributeValue = self.parent.execute_script(
- "return (%s).apply(null, arguments);" % raw,
137
+ "return (%s).apply(null, arguments);" % getAttribute_js,
138
self, name)
139
else:
140
resp = self._execute(Command.GET_ELEMENT_ATTRIBUTE, {'name': name})
0 commit comments