This commit is contained in:
王鹏
2026-04-09 14:55:54 +08:00
commit a2f5875d1b
60 changed files with 5210 additions and 0 deletions

28
core/browser.py Normal file
View File

@@ -0,0 +1,28 @@
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