import os, re, json from playwright.sync_api import sync_playwright TYPO = "\u2019" ASCII_APOS_PATTERNS = [r"\bl'(?=\w)", r"\bL'(?=\w)", r"\bd'(?=\w)", r"\bD'(?=\w)", r"\bqu'(?=\w)", r"\bQu'(?=\w)", r"\bn'(?=\w)", r"\bjusqu'(?=\w)"] def count_ascii(content): total = 0 for p in ASCII_APOS_PATTERNS: total += len(re.findall(p, content)) return total with sync_playwright() as p: browser = p.chromium.launch(headless=True, args=["--no-sandbox"]) context = browser.new_context(viewport={"width": 1440, "height": 900}) page = context.new_page() stages = [ ("Homepage", "https://weval-consulting.com/"), ("Marketplace", "https://weval-consulting.com/marketplace"), ("Products catalogue", "https://weval-consulting.com/products/"), ("WEVIA EM", "https://weval-consulting.com/products/wevia-em.html"), ("Consulting Pro", "https://weval-consulting.com/products/consulting-pro.html"), ("Suite Enterprise", "https://weval-consulting.com/solutions/wevia-enterprise.html"), ("Suite Advisory", "https://weval-consulting.com/solutions/advisory.html"), ] print(f"{'Page':<25} {'ASCII':>7} {'Typo':>7} {'Status'}") print("-"*55) clean = 0 for name, url in stages: page.goto(url + "?cb=v109-final", wait_until="networkidle", timeout=25000) page.wait_for_timeout(2500) c = page.content() a = count_ascii(c) t = c.count(TYPO) status = "✓ CLEAN" if a == 0 else f"✗ {a}" if a == 0: clean += 1 print(f"{name:<25} {a:>7} {t:>7} {status}") # Screenshot sdir = "/opt/weval-l99/pw-screenshots-v109" os.makedirs(sdir, exist_ok=True) fn = f"{sdir}/{name.replace(' ','-').lower()}.png" page.screenshot(path=fn, full_page=False) # Homepage client logos check page.goto("https://weval-consulting.com/?cb=logos", wait_until="networkidle", timeout=25000) page.wait_for_timeout(2500) logos_ok = [] for n in ["Abbott", "AbbVie", "Michelin", "LOreal", "Carrefour", "Nestle", "Servier"]: imgs = page.locator(f'img[src*="{n}"]').all() for img in imgs[:2]: try: if img.is_visible(): logos_ok.append(n); break except: pass print(f"\n{clean}/{len(stages)} pages CLEAN") print(f"Client logos visible: {logos_ok}") browser.close()