31 文字
1 分
Playwrightで任意のスクリプトを実行する
page.evaluate
メソッドを使用して、ページ内で任意のスクリプトを実行することができる。
https://playwright.dev/docs/evaluating
const href = await page.evaluate(() => document.location.href);
Playwrightで任意のスクリプトを実行する
https://blog.ohirunewani.com/posts/playwright-run-arbitrary-script/