DrissionPage
DrissionPage copied to clipboard
[BUG] 调用click.to_download()报TypeError错误,且下载文件重命名、后缀操作不起作用
BUG描述 调用click.to_download()报TypeError错误,且下载文件重命名、后缀操作不起作用。具体代码为 mission = (dl_ele.click.to_download(save_path='tmp', rename='test', suffix='.zip', new_tab=True))
报错信息为 Exception in thread Thread-2 (_handle_event_loop): Traceback (most recent call last): File "C:\Users\Siris\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner self.run() File "C:\Users\Siris\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in run self._target(*self._args, **self._kwargs) File "D:\Codes\PycharmProjects\xxx.venv\Lib\site-packages\DrissionPage_base\driver.py", line 156, in _handle_event_loop function(**event['params']) File "D:\Codes\PycharmProjects\xxx.venv\Lib\site-packages\DrissionPage_units\downloader.py", line 180, in _onDownloadWillBegin goal_path = Path(settings.path) / name ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Siris\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1163, in init super().init(*args) File "C:\Users\Siris\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 373, in init raise TypeError( TypeError: argument should be a str or an os.PathLike object where fspath returns a str, not 'NoneType'
环境信息
- 操作系统及版本: Win10 22H2 19045.4046
- 浏览器及版本: Google Chrome 123.0.6312.86(正式版本) (64 位)
- Python版本: python 3.12
- DrissionPage版本: 4.0.4.17