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=3&sort=relevance&tab=radar',wait_until='networkidle')
print(q.locator('.cat-hdr').all_text_contents())
for i in range(q.locator('.cat-hdr').count()):
h=q.locator('.cat-hdr').nth(i); body=h.locator('xpath=following-sibling::*[1]'); print(i,h.inner_text(),body.get_attribute('id'),body.get_attribute('class'))
h.click(); q.wait_for_timeout(100); print('after',body.get_attribute('class'))
b.close()