diff --git a/README.en.md b/README.en.md index 9bc7310..70cb9dc 100644 --- a/README.en.md +++ b/README.en.md @@ -43,7 +43,7 @@ What's even better is that its usage is very concise and user-friendly, with a s The following code implements exactly the same function, comparing the code amounts of the two: -1. Find the element whose first text contains 'some text' +1. Use explicit wait to find all elements whose text contains 'some text' ```python # selenium: @@ -850,7 +850,7 @@ Parameter Description: ### download -​ download(file_url: str, goal_path: str = None, rename: str = None, show_msg: bool = False, **kwargs) -> tuple +​ download(file_url: str, goal_path: str = None, rename: str = None, file_exists: str = 'rename', show_msg: bool = False, **kwargs) -> tuple ​ Download a file, return success and download information string. Changing the method will automatically avoid renaming the existing file in the target path. @@ -858,7 +858,8 @@ Parameter Description: - file_url - File URL - goal_path - Storage path, the default is the temporary folder specified in the ini file -- rename - Rename the file name, not renamed by default +- rename - Rename the file without changing the extension +- file_exists - If there is a file with the same name, you can choose 'rename', 'overwrite', 'skip' to process - show_msg - Show download massage or not. - kwargs - Connection parameters for requests diff --git a/README.zh-cn.md b/README.zh-cn.md index eabfb2c..2d5a3a4 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -41,7 +41,7 @@ DrissionPage,即driver和session的合体,是个基于python的Web自动化 以下代码实现一模一样的功能,对比两者的代码量: -1. 查找所有文本包含some text的元素 +1. 用显性等待方式查找所有文本包含some text的元素 ```python # selenium: @@ -849,7 +849,7 @@ MixPage封装了页面操作的常用功能,可在driver和session模式间无 ### download -​ download(file_url: str, goal_path: str = None, rename: str = None, show_msg: bool = False, **kwargs) -> tuple +​ download(file_url: str, goal_path: str = None, rename: str = None, file_exists: str = 'rename', show_msg: bool = False, **kwargs) -> tuple ​ 下载一个文件,返回是否成功和下载信息字符串。改方法会自动避免和目标路径现有文件重名。 @@ -857,7 +857,8 @@ MixPage封装了页面操作的常用功能,可在driver和session模式间无 - file_url - 文件URL - goal_path - 存放路径,默认为ini文件中指定的临时文件夹 -- rename - 重命名文件名,默认不重命名 +- rename - 重命名文件,不改变扩展名 +- file_exists - 若存在同名文件,可选择'rename', 'overwrite', 'skip'方式处理 - show_msg - 是否显示下载信息 - kwargs - 用于requests的连接参数