mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复xpath返回数字时出错的问题
This commit is contained in:
parent
b33b14c3a0
commit
1badd08827
@ -368,6 +368,9 @@ def execute_session_find(page_or_ele,
|
||||
else:
|
||||
ele = page_or_ele.cssselect(loc[1])
|
||||
|
||||
if not isinstance(ele, list):
|
||||
return ele
|
||||
|
||||
# 把lxml元素对象包装成SessionElement对象并按需要返回第一个或全部
|
||||
if mode == 'single':
|
||||
ele = ele[0] if ele else None
|
||||
|
Loading…
x
Reference in New Issue
Block a user