from playwright.sync_api import Playwright, sync_playwright, expect, Page from playwright_stealth import stealth_sync from logging import * def check_logged_in(page: Page): if "pas connecté à Microsoft Rewards" in page.content(): page.locator('css=[onclick="setsrchusr()"]').click() page.wait_for_load_state('load') info('Fixed logging in in card.')