diff --git a/DrissionPage/commons/browser.py b/DrissionPage/commons/browser.py index 86b3e9e..339091f 100644 --- a/DrissionPage/commons/browser.py +++ b/DrissionPage/commons/browser.py @@ -5,7 +5,7 @@ """ from json import load, dump from pathlib import Path -from subprocess import Popen +from subprocess import Popen, DEVNULL from tempfile import gettempdir from time import perf_counter, sleep @@ -173,7 +173,7 @@ def _run_browser(port, path: str, args) -> Popen: arguments = [p, f'--remote-debugging-port={port}'] arguments.extend(args) try: - return Popen(arguments, shell=False) + return Popen(arguments, shell=False, stdout=DEVNULL, stderr=DEVNULL) except FileNotFoundError: raise FileNotFoundError('未找到浏览器,请手动指定浏览器可执行文件路径。') diff --git a/DrissionPage/setter.py b/DrissionPage/setter.py index a49bbfd..8cce32c 100644 --- a/DrissionPage/setter.py +++ b/DrissionPage/setter.py @@ -42,7 +42,7 @@ class ChromiumBaseSetter(object): """ if implicit is not None: self._page.timeouts.implicit = implicit - self._page.timeout = implicit + self._page._timeout = implicit if page_load is not None: self._page.timeouts.page_load = page_load