mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
完善对xpath获取数字结果的支持
This commit is contained in:
parent
88f22bad84
commit
7f6285f3cd
@ -685,8 +685,14 @@ class ElementsByXpath(object):
|
||||
return e
|
||||
|
||||
# 找不到目标时
|
||||
except JavascriptException as err:
|
||||
if 'The result is not a node set' in err.msg:
|
||||
try:
|
||||
return get_nodes(the_node, xpath_txt=self.xpath, type_txt='1')
|
||||
except JavascriptException:
|
||||
return None
|
||||
else:
|
||||
return None
|
||||
|
||||
elif self.mode == 'all':
|
||||
return ([DriverElement(x, self.page) if isinstance(x, WebElement)
|
||||
|
Loading…
x
Reference in New Issue
Block a user