#!/usr/bin/env python3 """ Quick test to check interface and then test timeout behavior """ import asyncio from playwright.async_api import async_playwright async def quick_test(): async with async_playwright() as p: browser = await p.chromium.launch(headless=False) context = await browser.new_context(viewport={"width": 1920, "height": 1080}) page = await context.new_page() try: print("šŸ” Testing login...") await page.goto("https://read.amazon.com/?asin=B0DJP2C8M6&ref_=kwl_kr_iv_rec_1") await page.wait_for_timeout(8000) if "signin" in page.url: print(" Login required, proceeding...") email_field = await page.wait_for_selector("#ap_email", timeout=10000) await email_field.fill("ondrej.glaser@gmail.com") continue_btn = await page.wait_for_selector("#continue", timeout=5000) await continue_btn.click() await page.wait_for_timeout(3000) password_field = await page.wait_for_selector("#ap_password", timeout=10000) await password_field.fill("csjXgew3In") signin_btn = await page.wait_for_selector("#signInSubmit", timeout=5000) await signin_btn.click() await page.wait_for_timeout(8000) print("āœ… Login completed") print(f"šŸ“ Current URL: {page.url}") # Check what elements are available print("šŸ” Looking for reader elements...") # Try different selectors selectors_to_try = [ "#reader-header", "[id*='reader']", ".reader-header", "ion-header", "canvas", ".kindle-reader" ] for selector in selectors_to_try: try: element = await page.query_selector(selector) if element: print(f" āœ… Found: {selector}") else: print(f" āŒ Not found: {selector}") except Exception as e: print(f" āŒ Error with {selector}: {e}") # Take screenshot to see current state await page.screenshot(path="debug_current_state.png") print("šŸ“ø Screenshot saved: debug_current_state.png") # Wait for manual inspection print("\nā³ Waiting 60 seconds for inspection...") await page.wait_for_timeout(60000) except Exception as e: print(f"āŒ Error: {e}") import traceback traceback.print_exc() finally: await browser.close() if __name__ == "__main__": asyncio.run(quick_test())