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