def __init__(self, options: Dict[str, Any] = None, **kwargs: Any) -> None:
"""Make new launcher."""
self.options = options or dict()
self.options.update(kwargs)
self.chrome_args = DEFAULT_ARGS
self._tmp_user_data_dir: Optional[str] = None
self._parse_args()
if 'headless' not in self.options or self.options.get('headless'):
self.chrome_args = self.chrome_args + [
'--headless',
'--disable-gpu',
'--hide-scrollbars',
'--mute-audio',
]
if 'executablePath' in self.options:
self.exec = self.options['executablePath']
else:
if not check_chromium():
download_chromium()
self.exec = str(chromium_excutable())
self.cmd = [self.exec] + self.chrome_args
评论列表
文章目录