from playwright.sync_api import sync_playwright import re, json with sync_playwright() as p: browser = p.chromium.launch(headless=True, args=["--no-sandbox"]) ctx = browser.new_context(viewport={"width":1440,"height":900}) page = ctx.new_page() # Public pages (zero regression from earlier phases) pages = [ ("Home", "https://weval-consulting.com/"), ("Products", "https://weval-consulting.com/products/"), ("ReachHCP", "https://weval-consulting.com/products/reachhcp.html"), ("WEVIA Master product", "https://weval-consulting.com/products/wevia-master.html"), ("Suite Enterprise", "https://weval-consulting.com/solutions/wevia-enterprise.html"), ("Marketplace", "https://weval-consulting.com/marketplace"), ("Business KPI Dashboard (V83)", "https://weval-consulting.com/business-kpi-dashboard.php"), ] print(f"{'Page':<32} {'code':>5} {'Logout':>7} {'ASCII':>6} {'Typo':>5}") print("-"*70) APOS_P = [r"\bl'(?=\w)", r"\bL'(?=\w)", r"\bd'(?=\w)", r"\bqu'(?=\w)", r"\bn'(?=\w)"] for name, url in pages: try: resp = page.goto(url + "?cb=final-b12", wait_until="networkidle", timeout=20000) page.wait_for_timeout(2000) code = resp.status if resp else 0 c = page.content() # Logout check lg = 0 for sel in ["#weval-gl", "#weval-global-logout"]: if page.locator(sel).count() > 0: try: if page.locator(sel).first.is_visible(): lg = 1; break except: pass # ASCII apos a = sum(len(re.findall(p_re, c)) for p_re in APOS_P) t = c.count("\u2019") print(f"{name:<32} {code:>5} {lg:>7} {a:>6} {t:>5}") except Exception as e: print(f"{name:<32} ERROR {str(e)[:30]}") browser.close()