← back to Nationalrealestate

herocap.cjs

13 lines

const { chromium } = require('playwright');
(async () => {
  const b = await chromium.launch();
  const page = await b.newPage({ viewport: { width: 1280, height: 720 } });
  await page.goto('https://corkwallcovering.com/', { waitUntil:'networkidle', timeout:30000 });
  await page.waitForTimeout(1500);
  const livingTexture = await page.locator('text=Living Texture').count().catch(()=>0);
  const heroImg = await page.evaluate(()=>{ const b=document.getElementById('heroBg'); return b?getComputedStyle(b).backgroundImage:'' ; });
  console.log('"Living Texture" on page:', livingTexture, '| heroBg image:', heroImg.slice(0,60));
  await page.screenshot({ path:'/tmp/cork-hero-live.png' });
  await b.close();
})().catch(e=>{console.error('ERR',e.message);process.exit(1)});