diff --git a/deno-playwright/README.md b/deno-playwright/README.md new file mode 100644 index 0000000..67c07e9 --- /dev/null +++ b/deno-playwright/README.md @@ -0,0 +1,4 @@ +``` +$ deno -A npm:playwright install +$ deno -A main.ts +``` diff --git a/deno-playwright/deno.json b/deno-playwright/deno.json new file mode 100644 index 0000000..0e46c9d --- /dev/null +++ b/deno-playwright/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "playwright": "npm:playwright@^1.48.2" + } +} diff --git a/deno-playwright/deno.lock b/deno-playwright/deno.lock new file mode 100644 index 0000000..42ab723 --- /dev/null +++ b/deno-playwright/deno.lock @@ -0,0 +1,27 @@ +{ + "version": "4", + "specifiers": { + "npm:playwright@*": "1.48.2", + "npm:playwright@^1.48.2": "1.48.2" + }, + "npm": { + "fsevents@2.3.2": { + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==" + }, + "playwright-core@1.48.2": { + "integrity": "sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==" + }, + "playwright@1.48.2": { + "integrity": "sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==", + "dependencies": [ + "fsevents", + "playwright-core" + ] + } + }, + "workspace": { + "dependencies": [ + "npm:playwright@^1.48.2" + ] + } +} diff --git a/deno-playwright/main.ts b/deno-playwright/main.ts new file mode 100644 index 0000000..03eeda8 --- /dev/null +++ b/deno-playwright/main.ts @@ -0,0 +1,8 @@ +import { chromium } from "npm:playwright"; + +const browser = await chromium.launch({ headless: false }); +const page = await browser.newPage(); + +await page.goto("https://example.com"); +await new Promise((r) => setTimeout(r, 10_000)); +await browser.close();