| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- """Observe 996box login page: screenshot + dump login form HTML.
- No interaction, no risk. Just open the page in Edge and report what's there.
- """
- import asyncio
- import sys
- from pathlib import Path
- _HERE = Path(__file__).resolve().parent
- sys.path.insert(0, str(_HERE.parent / "src"))
- from playwright.async_api import async_playwright
- EDGE = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
- URL = "https://pc.hzwlan.com/login/account"
- async def main():
- out = _HERE / "jfbym_diag"
- out.mkdir(exist_ok=True)
- async with async_playwright() as p:
- browser = await p.chromium.launch(
- executable_path=EDGE, headless=True,
- args=["--disable-blink-features=AutomationControlled"],
- )
- ctx = await browser.new_context(
- viewport={"width": 1366, "height": 768},
- user_agent=("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 "
- "(KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 "
- "Edg/108.0.1462.54"),
- )
- page = await ctx.new_page()
- await page.goto(URL, wait_until="networkidle", timeout=30000)
- await page.wait_for_timeout(1500)
- # Full page screenshot
- shot = out / "996box_login_full.png"
- await page.screenshot(path=str(shot), full_page=True)
- print(f"screenshot: {shot} ({shot.stat().st_size // 1024} KB)")
- # URL after load (sometimes redirects)
- print(f"final URL: {page.url}")
- # Dump all buttons + inputs + tabs with their text
- info = await page.evaluate("""() => {
- const r = {url: location.href, title: document.title};
- r.buttons = [...document.querySelectorAll('button')].map(b => ({
- tag: b.tagName, cls: b.className, text: (b.innerText||'').trim().slice(0,40),
- type: b.type, id: b.id, name: b.name, visible: b.offsetParent !== null
- }));
- r.inputs = [...document.querySelectorAll('input')].map(i => ({
- tag: i.tagName, type: i.type, cls: i.className, id: i.id,
- name: i.name, placeholder: i.placeholder, value: i.value
- }));
- r.tabs = [...document.querySelectorAll('[role=tab], .ant-tabs-tab')].map(t => ({
- tag: t.tagName, cls: t.className, text: (t.innerText||'').trim().slice(0,40),
- active: t.classList.contains('ant-tabs-tab-active')
- }));
- r.geetest = !!document.querySelector('.geetest_') || !!document.querySelector('iframe[src*="geetest"]');
- r.body_class = document.body.className;
- r.form_count = document.querySelectorAll('form').length;
- return r;
- }""")
- print(f"\ntitle: {info['title']}")
- print(f"body_class: {info['body_class']}")
- print(f"geetest_present: {info['geetest']}")
- print(f"form_count: {info['form_count']}")
- print(f"\n--- buttons ({len(info['buttons'])}) ---")
- for b in info["buttons"]:
- print(f" <{b['tag']} class='{b['cls'][:60]}' type={b['type']} id={b['id']!r}> "
- f"text='{b['text']}' visible={b['visible']}")
- print(f"\n--- inputs ({len(info['inputs'])}) ---")
- for i in info["inputs"]:
- print(f" <{i['tag']} type='{i['type']}' id='{i['id']}' name='{i['name']}' "
- f"placeholder='{i['placeholder']}'>")
- print(f"\n--- tabs ({len(info['tabs'])}) ---")
- for t in info["tabs"]:
- print(f" <{t['tag']} class='{t['cls'][:50]}' active={t['active']}> text='{t['text']}'")
- await browser.close()
- asyncio.run(main())
|