mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-05 05:28:43 +08:00
修复了元素ele()处理类似'./node()'、'./text()'失效的问题
This commit is contained in:
parent
caa205483c
commit
04112d95e0
@ -257,7 +257,8 @@ def execute_session_find(page_or_ele: BaseParser,
|
||||
ele = page_or_ele.find(loc_str)
|
||||
|
||||
if mode == 'single':
|
||||
return SessionElement(ele[0]) if ele else None
|
||||
ele = ele[0] if ele else None
|
||||
return SessionElement(ele) if isinstance(ele, Element) else ele
|
||||
elif mode == 'all':
|
||||
return [SessionElement(e) if isinstance(e, Element) else e for e in ele]
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user