mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 22:08:02 +00:00
11 lines
346 B
TypeScript
11 lines
346 B
TypeScript
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();
|