55 lines
2.2 KiB
Python
55 lines
2.2 KiB
Python
|
|
import re
|
|
from playwright.sync_api import sync_playwright
|
|
|
|
TYPO = "\u2019"
|
|
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)"]
|
|
|
|
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"),
|
|
("Suite Marketing", "https://weval-consulting.com/solutions/marketing-cloud.html"),
|
|
("Suite Pharma", "https://weval-consulting.com/solutions/pharma-cloud.html"),
|
|
]
|
|
|
|
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()
|
|
|
|
print(f"{'Page':<25} {'ASCII':>7} {'Typo':>7} Status")
|
|
print("-"*55)
|
|
clean = 0
|
|
for name, url in stages:
|
|
page.goto(url + "?cb=final-v109", wait_until="networkidle", timeout=25000)
|
|
page.wait_for_timeout(2500)
|
|
c = page.content()
|
|
a = 0
|
|
for p_re in PATTERNS: a += len(re.findall(p_re, c))
|
|
t = c.count(TYPO)
|
|
st = "✓ CLEAN" if a == 0 else f"✗ {a}"
|
|
if a == 0: clean += 1
|
|
print(f"{name:<25} {a:>7} {t:>7} {st}")
|
|
|
|
# Client logos homepage
|
|
page.goto("https://weval-consulting.com/?cb=logo-final", wait_until="networkidle", timeout=25000)
|
|
page.wait_for_timeout(2500)
|
|
logos = []
|
|
for n in ["Abbott", "AbbVie", "Michelin", "LOreal", "Carrefour", "Nestle", "Servier", "Bombardier"]:
|
|
imgs = page.locator(f'img[src*="{n}"]').all()
|
|
for im in imgs[:1]:
|
|
try:
|
|
if im.is_visible(): logos.append(n)
|
|
except: pass
|
|
|
|
print(f"\n{clean}/{len(stages)} pages CLEAN")
|
|
print(f"Client logos visible: {logos}")
|
|
browser.close()
|