Skip to content
cccskills
FreePublished on GitHub

playwright

Playwright セットアップ・利用ガイド。headless Chromium によるブラウザ自動化の共通パターン。

The English summary is being prepared. Showing the original description.

Works withPlaywright
See how to install

Files included (1)

  • SKILL.md3.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Playwright スキル

headless Chromium によるブラウザ自動化の共通基盤。

概要

項目値
Python venv.venv/ (プロジェクトルート)
ブラウザChromium (Playwright 管理)
用途Dell FW ダウンロード、BMC KVM スクリーンショット

セットアップ手順

1. venv 作成と playwright インストール

uv venv .venv
uv pip install --python .venv/bin/python playwright
.venv/bin/playwright install chromium

2. 追加パッケージ (用途に応じて)

uv pip install --python .venv/bin/python Pillow   # BMC KVM スクリーンショット (画像処理)

確認方法

.venv/bin/playwright --version
.venv/bin/python -c "from playwright.sync_api import sync_playwright; print('OK')"

ステルスモードパターン

CDN のボット検知 (Akamai 等) を回避するパターン。Dell ダウンロードサイト等で必要。

browser = p.chromium.launch(
    headless=True,
    args=["--no-sandbox", "--disable-gpu"],
)
context = browser.new_context(
    user_agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 "
               "(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
)
# webdriver プロパティを隠蔽
page = context.new_page()
page.add_init_script("""
    Object.defineProperty(navigator, 'webdriver', {get: () => undefined});
""")
  • user_agent: 実在の Chrome バージョンに合わせる
  • webdriver=false: ボット検知の最も基本的な回避策

ダウンロードハンドリング

ファイルダウンロードを自動処理するパターン:

context = browser.new_context(accept_downloads=True)
page = context.new_page()

with page.expect_download(timeout=300000) as download_info:
    page.goto(download_url)
download = download_info.value
download.save_as(save_path)
  • accept_downloads=True: ダウンロードダイアログを自動承認
  • expect_download: ダウンロード開始を待機。timeout はファイルサイズに応じて調整
  • ダウンロード先ページに遷移する前に expect_download を開始する

HTTPS 証明書エラー回避

BMC 等の自己署名証明書サイトにアクセスするパターン:

browser = p.chromium.launch(
    headless=True,
    args=["--ignore-certificate-errors", "--no-sandbox", "--disable-gpu"],
)
context = browser.new_context(ignore_https_errors=True)

既存使用箇所

スクリプト用途
scripts/bmc-kvm-screenshot.pyBMC HTML5 KVM の canvas キャプチャ
dell-fw-download スキルDell CDN からの FW ダウンロード

注意事項

  • venv パス: スクリプトは .venv/bin/python を auto-detect する (bmc-kvm-screenshot.py 参照)
  • Chromium 依存: playwright install chromium でインストールされた Chromium を使用。OS の Chrome とは独立
  • ヘッドレスのみ: サーバ環境のため GUI なし。headless=True 必須

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Supermicro X11DPU/X10DRT-P BIOS Setup 操作。KVM スクリーンショット + キーストロークで BIOS メニューを操作する。BIOS 設定変更、確認、保存を行う。4-6号機 + 10号機対応。

The English summary is being prepared. Showing the original description.

miminashi/pvese19Updated Jul 6, 2026

Dell ファームウェアダウンロード。Playwright で dl.dell.com から BIN を取得し firmimg.d7 を抽出する。

The English summary is being prepared. Showing the original description.

miminashi/pvese19Updated Jul 6, 2026

Mellanox SX6036 InfiniBand スイッチのシリアルコンソール操作。ステータス確認、show コマンド、IB 設定、FW 管理を行う。

The English summary is being prepared. Showing the original description.

miminashi/pvese19Updated Jul 6, 2026

idrac7

Free

iDRAC7 基本操作。SSH 経由で racadm コマンドを実行し、サーバ管理を行う。

The English summary is being prepared. Showing the original description.

miminashi/pvese19Updated Jul 6, 2026

iDRAC7 ファームウェアアップデート。段階的アップグレードパスに従い TFTP 経由で適用する。

The English summary is being prepared. Showing the original description.

miminashi/pvese19Updated Jul 6, 2026

Fujitsu iRMC S4 (TX1320 M3 等) の電源・BIOS・RAID 操作 + BIOS 設定リファレンス。Redfish (HTTPS + SECLEVEL=0) 経由の電源/ブート操作 + iRMC Web UI/KVM 経由の手動 BIOS/RAID 操作手順 + 全 BIOS 設定項目の網羅リファレンス (bios/)。training-tx1320 対応。

The English summary is being prepared. Showing the original description.

miminashi/pvese19Updated Jul 6, 2026

See all skills by miminashi

Report a problem with this skill