mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复获取before的一个小问题
This commit is contained in:
parent
455f805eba
commit
e603a9d38c
@ -264,8 +264,9 @@ class DrissionElement(BaseElement):
|
|||||||
nodes = [e for e in nodes if not (isinstance(e, str) and sub('[ \n\t\r]', '', e) == '')]
|
nodes = [e for e in nodes if not (isinstance(e, str) and sub('[ \n\t\r]', '', e) == '')]
|
||||||
|
|
||||||
if nodes and index is not None:
|
if nodes and index is not None:
|
||||||
|
index = index - 1 if direction == 'following' else -index
|
||||||
try:
|
try:
|
||||||
return [nodes[index - 1]]
|
return [nodes[index]]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return []
|
return []
|
||||||
else:
|
else:
|
||||||
|
2
setup.py
2
setup.py
@ -6,7 +6,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="DrissionPage",
|
name="DrissionPage",
|
||||||
version="2.4.2",
|
version="2.4.3",
|
||||||
author="g1879",
|
author="g1879",
|
||||||
author_email="g1879@qq.com",
|
author_email="g1879@qq.com",
|
||||||
description="A module that integrates selenium and requests session, encapsulates common page operations.",
|
description="A module that integrates selenium and requests session, encapsulates common page operations.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user