diff --git a/DrissionPage/_units/clicker.py b/DrissionPage/_units/clicker.py index 9097080..83e5e23 100644 --- a/DrissionPage/_units/clicker.py +++ b/DrissionPage/_units/clicker.py @@ -127,6 +127,8 @@ class Clicker(object): tmp_save_path = str(Path(save_path).absolute()) else: self._ele.tab.set.download_path(save_path) + elif new_tab: + tmp_save_path = self._ele.owner._tab.download_path obj = self._ele.tab._browser if new_tab else self._ele.owner._tab if rename or suffix: diff --git a/DrissionPage/_units/setter.py b/DrissionPage/_units/setter.py index acff5ac..b9b96e6 100644 --- a/DrissionPage/_units/setter.py +++ b/DrissionPage/_units/setter.py @@ -266,6 +266,9 @@ class ChromiumPageSetter(TabSetter): super().download_path(path) self._owner.browser.set.download_path(path) + def download_file_name(self, name=None, suffix=None): + self._owner.browser.set.download_file_name(name, suffix) + class WebPageSetter(ChromiumPageSetter): def __init__(self, owner):