#!/usr/bin/env python3
"""Cari riwayat pembaruan Google Agustus 2026 dengan peramban sungguhan."""
import asyncio, re


async def main():
    from playwright.async_api import async_playwright
    async with async_playwright() as pw:
        br = await pw.chromium.launch()
        ctx = await br.new_context(user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/124.0 Safari/537.36",
                                   locale="en-US")
        hal = await ctx.new_page()
        for nama, u in (("Search Engine Land", "https://searchengineland.com/library/platforms/google/google-algorithm-updates"),
                        ("Seroundtable", "https://www.seroundtable.com/category/google-updates"),
                        ("Google Status Dashboard", "https://status.search.google.com/")):
            try:
                await hal.goto(u, wait_until="domcontentloaded", timeout=70000)
                await hal.wait_for_timeout(4000)
                teks = re.sub(r"\s+", " ", await hal.inner_text("body"))
                print(f"\n=== {nama} | {len(teks):,} karakter ===")
                pola = re.findall(r".{0,120}(?:August|Aug)[^.]{0,30}(?:2026).{0,150}", teks, re.I)
                if pola:
                    for x in pola[:6]:
                        print("   »", x[:280])
                else:
                    print("   (tidak ada sebutan Agustus 2026)")
                    print("   cuplikan:", teks[:300])
            except Exception as e:
                print(f"\n=== {nama} → gagal: {str(e)[:90]}")
        await br.close()


asyncio.run(main())
