feat: playwright scraper
This commit is contained in:
7767
playwright/scraper/pages/dashboard-ipadpro.html
Normal file
7767
playwright/scraper/pages/dashboard-ipadpro.html
Normal file
File diff suppressed because one or more lines are too long
BIN
playwright/scraper/pages/dashboard-ipadpro.png
Normal file
BIN
playwright/scraper/pages/dashboard-ipadpro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 285 KiB |
25
playwright/scraper/scrape-dashboard.mjs
Normal file
25
playwright/scraper/scrape-dashboard.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
// playwright/scraper/scrape-dashboard.js
|
||||
import { chromium, devices } from "playwright";
|
||||
import { writeFileSync } from "fs";
|
||||
|
||||
const browser = await chromium.launch();
|
||||
const context = await browser.newContext({
|
||||
...devices["iPad Pro 11 landscape"],
|
||||
});
|
||||
const page = await context.newPage();
|
||||
await page.goto("http://localhost:3000/dashboard", {
|
||||
waitUntil: "networkidle",
|
||||
});
|
||||
|
||||
// HTML speichern
|
||||
const html = await page.content();
|
||||
writeFileSync("playwright/scraper/pages/dashboard-ipadpro.html", html);
|
||||
|
||||
// Screenshot speichern
|
||||
await page.screenshot({
|
||||
path: "playwright/scraper/pages/dashboard-ipadpro.png",
|
||||
fullPage: true,
|
||||
});
|
||||
|
||||
await browser.close();
|
||||
// node playwright/scraper/scrape-dashboard.js
|
||||
Reference in New Issue
Block a user