import os from playwright.sync_api import sync_playwright def check_huggingface_login(): # This assumes your copied Chrome profile is in "./chrome_profile" user_data_dir = os.path.join(os.getcwd(), "chrome_profile") with sync_playwright() as p: # Launch a persistent context using your Chrome profile context = p.chromium.launch_persistent_context( user_data_dir=user_data_dir, headless=False # Launch in non-headless mode so you can visually inspect the page ) page = context.new_page() # Navigate to Hugging Face homepage page.goto("https://huggingface.co") page.wait_for_load_state("networkidle") print("Browser opened. Please inspect the page to verify that you are logged in (e.g., look for your profile avatar or username).") input("Press Enter to close the browser once you've confirmed the login status...") context.close() if __name__ == "__main__": check_huggingface_login()