mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复set.timeouts()问题;屏蔽Linux和MAC系统中运行时那些啰嗦的提示
This commit is contained in:
parent
dbabe35489
commit
5f429840f8
@ -5,7 +5,7 @@
|
|||||||
"""
|
"""
|
||||||
from json import load, dump
|
from json import load, dump
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import Popen
|
from subprocess import Popen, DEVNULL
|
||||||
from tempfile import gettempdir
|
from tempfile import gettempdir
|
||||||
from time import perf_counter, sleep
|
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 = [p, f'--remote-debugging-port={port}']
|
||||||
arguments.extend(args)
|
arguments.extend(args)
|
||||||
try:
|
try:
|
||||||
return Popen(arguments, shell=False)
|
return Popen(arguments, shell=False, stdout=DEVNULL, stderr=DEVNULL)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
raise FileNotFoundError('未找到浏览器,请手动指定浏览器可执行文件路径。')
|
raise FileNotFoundError('未找到浏览器,请手动指定浏览器可执行文件路径。')
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class ChromiumBaseSetter(object):
|
|||||||
"""
|
"""
|
||||||
if implicit is not None:
|
if implicit is not None:
|
||||||
self._page.timeouts.implicit = implicit
|
self._page.timeouts.implicit = implicit
|
||||||
self._page.timeout = implicit
|
self._page._timeout = implicit
|
||||||
|
|
||||||
if page_load is not None:
|
if page_load is not None:
|
||||||
self._page.timeouts.page_load = page_load
|
self._page.timeouts.page_load = page_load
|
||||||
|
Loading…
x
Reference in New Issue
Block a user