mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
优化set_attr()
This commit is contained in:
parent
066caf2f23
commit
30cd456cd1
@ -460,7 +460,7 @@ class DriverElement(DrissionElement):
|
|||||||
:return: 是否设置成功
|
:return: 是否设置成功
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
self.run_script(f"arguments[0].{attr} = '{value}';")
|
self.run_script(f"arguments[0].setAttribute(arguments[1], arguments[2]);", attr, value)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user