Explorer
/tmp/p6_browser_final.py
← Zurück ↓ Download
import asyncio
from playwright.async_api import async_playwright
async def main():
 async with async_playwright() as p:
  b=await p.chromium.launch(headless=True,executable_path='/snap/bin/chromium',args=['--no-sandbox'])
  page=await b.new_page(viewport={'width':1440,'height':1000})
  r=await page.goto('http://127.0.0.1:8652/cockpit?days=14&sort=facebook&tab=radar',wait_until='domcontentloaded')
  await page.wait_for_timeout(400); text=await page.locator('body').inner_text()
  print({'http':r.status,'cards':await page.locator('.sig').count(),'meta':text.count('META AD'),'started':('Gestartet:' in text),'last_seen':('Zuletzt aktiv bestätigt:' in text),'status':('Status: ACTIVE' in text),'sorts':all(x in text for x in ['Priorität ↓','Score ↓','Neu ↓','Viral ↓'])})
  await page.screenshot(path='/tmp/p6_fb14_final.png',full_page=True)
  thumb=page.locator('.sig .thumb').first; await thumb.click(); await page.wait_for_timeout(100)
  print({'detail_panel':await page.locator('#pcontent.on').count()==1})
  await b.close()
asyncio.run(main())