Files
yidaima_tools/core/browser.py

29 lines
691 B
Python
Raw Permalink Normal View History

2026-04-09 14:55:54 +08:00
from __future__ import annotations
"""
本项目的核心是桌面 OCR + 点击若后续需要操作 Web DMS/ERP可以在此处接入 Playwright
当前先提供一个最小骨架避免影响主流程
"""
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class BrowserConfig:
headless: bool = False
slow_mo_ms: int = 0
user_data_dir: Optional[str] = None
class Browser:
def __init__(self, config: BrowserConfig = BrowserConfig()) -> None:
self.config = config
def __enter__(self) -> "Browser":
return self
def __exit__(self, exc_type, exc, tb) -> None:
return None