diff --git a/DrissionPage/action_chains.py b/DrissionPage/action_chains.py index 0cb0c6e..b9edcaa 100644 --- a/DrissionPage/action_chains.py +++ b/DrissionPage/action_chains.py @@ -252,13 +252,14 @@ class ActionChains: def type(self, text): """输入文本 - :param text: 要输入的文本 + :param text: 要输入的文本,特殊字符和多个文本可用list或tuple传入 :return: self """ for i in text: - self.key_down(i) - sleep(.05) - self.key_up(i) + for character in i: + self.key_down(character) + sleep(.05) + self.key_up(character) return self def wait(self, second): diff --git a/DrissionPage/action_chains.pyi b/DrissionPage/action_chains.pyi index da4d558..3b54a49 100644 --- a/DrissionPage/action_chains.pyi +++ b/DrissionPage/action_chains.pyi @@ -65,7 +65,7 @@ class ActionChains: def key_up(self, key: str) -> ActionChains: ... - def type(self, text: str) -> ActionChains: ... + def type(self, text: Union[str, list, tuple]) -> ActionChains: ... def wait(self, second: float) -> ActionChains: ...