0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Tips

qiita_gif_playwright.gif

index.ts
import { chromium } from "playwright"


const test = async ()=>{
    const browser = await chromium.launch({
        headless: false,
        devtools: true
      });
        const context = await browser.newContext();
        const page = await context.newPage();
        await page.goto('https://qiita.com/koji0705');
          // DevTools Protocolセッションを開始
  const client = await context.newCDPSession(page);
  console.log('=======HIT8 client 1111111111', )
    const result = await client.send('Runtime.evaluate', {
        expression: `
          (function() {
            console.log('======= Hello World ===============')
          })()
        `,
        awaitPromise: true
      });

}

test()

DevToolのコンソールタブ内で関数を実行できました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?