1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 06:18:07 +00:00
_/playwright/main.ts

12 lines
346 B
TypeScript
Raw Normal View History

2024-08-26 11:11:06 +09:00
import { chromium } from "playwright";
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto("https://example.com/");
const l1 = await page.evaluate(() => location.href);
console.log(l1);
await page.click("a");
const l2 = await page.evaluate(() => location.href);
console.log(l2);
await browser.close();