mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修改海象运算符
This commit is contained in:
parent
22296abe95
commit
f1356bb324
@ -125,7 +125,8 @@ def avoid_duplicate_name(folder_path: str, file_name: str) -> str:
|
||||
:param file_name: 要检查的文件名
|
||||
:return: 可用的文件名
|
||||
"""
|
||||
while (file_Path := Path(folder_path).joinpath(file_name)).exists():
|
||||
file_Path = Path(folder_path).joinpath(file_name)
|
||||
while file_Path.exists():
|
||||
ext_name = file_Path.suffix
|
||||
base_name = file_Path.stem
|
||||
num = base_name.split(' ')[-1]
|
||||
@ -134,4 +135,5 @@ def avoid_duplicate_name(folder_path: str, file_name: str) -> str:
|
||||
file_name = f'{base_name.replace(f"({num})", "", -1)}({num + 1}){ext_name}'
|
||||
else:
|
||||
file_name = f'{base_name} (1){ext_name}'
|
||||
file_Path = Path(folder_path).joinpath(file_name)
|
||||
return file_name
|
||||
|
@ -23,7 +23,7 @@ DrissionPage,即driver和session的合体。
|
||||
- https://github.com/g1879/DrissionPage
|
||||
- https://gitee.com/g1879/DrissionPage
|
||||
|
||||
**联系邮箱:**g1879@qq.com
|
||||
**联系邮箱:** g1879@qq.com
|
||||
|
||||
# 特性
|
||||
|
||||
@ -243,6 +243,8 @@ element.location # 元素位置
|
||||
|
||||
因chrome和headers配置繁多,故设置一个ini文件专门用于保存常用配置,你可使用OptionsManager对象获取和保存配置,用DriverOptions对象修改chrome配置。你也可以保存多个ini文件,按不同项目须要调用。
|
||||
|
||||
注:建议把常用配置文件保存到别的路径,以防本库升级时配置被重置。
|
||||
|
||||
### ini文件内容
|
||||
|
||||
ini文件默认拥有三部分配置:paths、chrome_options、session_options,初始内容如下。
|
||||
|
4
setup.py
4
setup.py
@ -8,7 +8,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
||||
|
||||
setup(
|
||||
name="DrissionPage",
|
||||
version="0.8.0",
|
||||
version="0.8.3",
|
||||
author="g1879",
|
||||
author_email="g1879@qq.com",
|
||||
description="A module that integrates selenium and requests session, encapsulates common page operations.",
|
||||
@ -17,6 +17,7 @@ setup(
|
||||
license="BSD",
|
||||
keywords="DrissionPage",
|
||||
url="https://github.com/g1879/DrissionPage",
|
||||
include_package_data=True,
|
||||
packages=find_packages(),
|
||||
install_requires=[
|
||||
"selenium",
|
||||
@ -30,4 +31,5 @@ setup(
|
||||
"Topic :: Utilities",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
],
|
||||
python_requires='>=3.6'
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user