Playwright headless 设置
在 Suan API 设置中添加控制 playwright headless 模式的设置。
This commit is contained in:
@@ -6,6 +6,8 @@ from playwright.async_api import (
|
||||
async_playwright,
|
||||
)
|
||||
|
||||
from . import config
|
||||
|
||||
|
||||
class PlayContextManager:
|
||||
def __init__(
|
||||
@@ -26,7 +28,7 @@ class PlayContextManager:
|
||||
"""手动启动"""
|
||||
self.playwright = await async_playwright().start() # 不是 __enter__
|
||||
self.browser = await self.playwright.chromium.launch(
|
||||
headless=False,
|
||||
headless=config.get("schedule", "playwright_headless", True),
|
||||
args=[
|
||||
"--disable-blink-features=AutomationControlled",
|
||||
"--no-sandbox",
|
||||
|
||||
Reference in New Issue
Block a user