domovoy_bot/scraper_gis/mcp_test_auth.py

28 lines
928 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from playwright.sync_api import sync_playwright
import time
import os
print("🚀 Запускаем тестовый браузер для авторизации...")
with sync_playwright() as p:
browser = p.chromium.launch_persistent_context(
user_data_dir="/app/browser_context",
headless=False,
args=[
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu',
'--window-size=1280,1024'
]
)
page = browser.pages[0]
print("🌐 Переходим на dom.gosuslugi.ru...")
page.goto("https://dom.gosuslugi.ru/")
print("⏳ Окно открыто! У тебя есть 5 минут, чтобы авторизоваться через noVNC.")
time.sleep(300)
browser.close()
print("✅ Сессия сохранена, браузер закрыт.")