feat(install): specify chrome and chromium for playwright

- Install Chrome and Chromium browsers explicitly
- Split browser installation into separate commands
This commit is contained in:
UncleCode
2025-01-01 16:10:08 +08:00
parent 67f65f958b
commit 74a7c6dbb6

View File

@@ -16,7 +16,8 @@ def post_install():
def install_playwright():
logger.info("Installing Playwright browsers...", tag="INIT")
try:
subprocess.check_call([sys.executable, "-m", "playwright", "install", "--with-deps"])
subprocess.check_call([sys.executable, "-m", "playwright", "install", "--with-deps", "chrome"])
subprocess.check_call([sys.executable, "-m", "playwright", "install", "--with-deps", "chromium"])
logger.success("Playwright installation completed successfully.", tag="COMPLETE")
except subprocess.CalledProcessError as e:
# logger.error(f"Error during Playwright installation: {e}", tag="ERROR")