mirror of
https://github.com/kou029w/_.git
synced 2025-01-31 06:18:07 +00:00
12 lines
346 B
TypeScript
12 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();
|