← back to Rentv Tour

probe.mjs

25 lines

import { chromium } from 'playwright';
const BASE='https://rentv.agentabrams.com';
const b=await chromium.launch();
const ctx=await b.newContext({viewport:{width:1440,height:810},httpCredentials:{username:'user',password:'RentvUser2026!'}});
const p=await ctx.newPage();
await p.goto(BASE+'/',{waitUntil:'domcontentloaded'});
await p.waitForTimeout(1500);
// theme switcher
const themeInfo=await p.evaluate(()=>{
  const out={selects:[],themeEls:[]};
  document.querySelectorAll('select').forEach(s=>out.selects.push({id:s.id,cls:s.className,opts:[...s.options].map(o=>o.value+'|'+o.textContent.trim()).slice(0,12)}));
  document.querySelectorAll('[data-theme],[id*="theme" i],[class*="theme" i]').forEach(e=>out.themeEls.push({tag:e.tagName,id:e.id,cls:e.className,dt:e.getAttribute('data-theme'),txt:e.textContent.trim().slice(0,40)}));
  return out;
});
console.log('THEME:',JSON.stringify(themeInfo,null,1));
// article links
const links=await p.evaluate(()=>{
  const set=new Set();
  document.querySelectorAll('a[href]').forEach(a=>{const h=a.getAttribute('href');if(/news|article|story/i.test(h))set.add(h);});
  return [...set].slice(0,20);
});
console.log('ARTICLE LINKS:',links);
// check theme.js exists
await b.close();