LoginSignup
renbu
@renbu

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Python、Playwrightで起動済みのブラウザは操作できない?

Python、Playwrightで起動済みのブラウザは操作できないでしょうか?

通常使っているブラウザをそのまま流用したいです。

user_data_dirは指定できるようですが、Playwright用に新たにchromiumをインストールする以外ないでしょうか?

そもそも、Playwrightインストール時に、必ずchromiumがインストールされるんですか?

0

1Answer

起動済みのブラウザは操作できません。 Playwright にバンドルされたもの以外のブラウザを起動するには executablePath を指定すればいいですが、操作できるかどうかは保証されていません。
https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-executable-path

Playwright のインストール時にはブラウザもインストールされますが、事前に PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD 環境変数をセットすればスキップできます。
https://playwright.dev/docs/browsers#skip-browser-downloads

1

Your answer might help someone💌