import json
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
b=p.chromium.launch(headless=True); q=b.new_page(); q.goto('https://sma.agentsolutions-mallorca.com/cockpit?days=14&sort=relevance&tab=radar&ev=gates',wait_until='networkidle'); q.locator('#blocked-filter-btn').click()
ids=q.evaluate("Object.values(window._S).filter(s=>!s.mas_relevant).map(s=>s.id)")
assert ids
q.locator('#sig-'+ids[0]+' .thumb').click(force=True); t=q.locator('#pcontent').inner_text(); print({'irrelevant_id':ids[0],'post_analyse': 'Post analysieren' in t,'post_create':'Post erstellen' in t,'blocked_or_irrelevant':('Kein fachlicher MAS-Bezug' in t or 'Nicht für MAS-Content geeignet' in t)})
assert 'Post analysieren' not in t and 'Post erstellen' not in t
b.close()