模拟障碍物 继续作业 连续作业 初始化
This commit is contained in:
15
scripts/probe_login.mjs
Normal file
15
scripts/probe_login.mjs
Normal file
@@ -0,0 +1,15 @@
|
||||
import { chromium } from 'playwright';
|
||||
|
||||
const browser = await chromium.launch({ channel: 'msedge', headless: true });
|
||||
const page = await browser.newPage({ viewport: { width: 1680, height: 1050 } });
|
||||
await page.goto('http://127.0.0.1:3001/login', { waitUntil: 'domcontentloaded' });
|
||||
await page.waitForTimeout(3000);
|
||||
const info = await page.evaluate(() => {
|
||||
const inputs = [...document.querySelectorAll('input')].map(i => ({
|
||||
type: i.type, id: i.id, name: i.name, ph: i.placeholder, cls: i.className.slice(0, 60)
|
||||
}));
|
||||
const btns = [...document.querySelectorAll('button')].map(b => ({ text: b.innerText.trim().slice(0, 20), cls: b.className.slice(0, 60) }));
|
||||
return { inputs, btns, title: document.title, url: location.href };
|
||||
});
|
||||
console.log(JSON.stringify(info, null, 2));
|
||||
await browser.close();
|
||||
Reference in New Issue
Block a user