import {chromium} from 'playwright'; const b = await chromium.launch({channel: 'chrome'}); const p = await b.newPage({viewport: {width: 1280, height: 900}}); await p.goto('http://localhost/s/stay', {waitUntil: 'domcontentloaded'}); await p.waitForTimeout(5000); await p.click('#w4d-toggle'); await p.waitForTimeout(300); const rows = await p.$$('.w4d-item'); await rows[0].click(); // 1번 곡 await p.waitForTimeout(1500); const seq = []; seq.push(await p.evaluate(() => document.getElementById('w4d-now').textContent)); // 목록에서 다음 줄을 눌러 순서 확인 + 재생 중 표시가 따라오는지 for (let i = 1; i < 5; i++) { await rows[i].click(); await p.waitForTimeout(900); seq.push(await p.evaluate(() => document.getElementById('w4d-now').textContent)); } const cur = await p.evaluate(() => { const row = document.querySelector('.w4d-item[data-playing="1"]'); return {row: row?.querySelector('.w4d-t').textContent, time: row?.querySelector('.w4d-time').textContent}; }); console.log('목록 순서', JSON.stringify(seq)); console.log('재생 중 줄', JSON.stringify(cur)); await b.close();