Spaces:
Sleeping
Sleeping
| """ | |
| 🤖 Fagun Browser Automation Testing Agent - Hugging Face Spaces Entry Point | |
| ========================================== | |
| A powerful, intelligent browser automation tool that performs comprehensive website testing. | |
| Author: Mejbaur Bahar Fagun | |
| Role: Software Engineer in Test | |
| LinkedIn: https://www.linkedin.com/in/mejbaur/ | |
| """ | |
| import os | |
| import sys | |
| # Set UTF-8 encoding for Windows console | |
| if sys.platform.startswith('win'): | |
| import codecs | |
| sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach()) | |
| sys.stderr = codecs.getwriter('utf-8')(sys.stderr.detach()) | |
| # Disable telemetry before importing browser-use | |
| os.environ["BROWSER_USE_TELEMETRY"] = "false" | |
| os.environ["BROWSER_USE_DISABLE_TELEMETRY"] = "true" | |
| os.environ["BROWSER_USE_NO_TELEMETRY"] = "true" | |
| os.environ["DISABLE_TELEMETRY"] = "true" | |
| os.environ["NO_TELEMETRY"] = "true" | |
| # Configure logging | |
| import logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
| handlers=[logging.StreamHandler(sys.stdout)] | |
| ) | |
| logging.getLogger("browser_use").setLevel(logging.WARNING) | |
| logging.getLogger("posthog").setLevel(logging.WARNING) | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| from src.webui.interface import create_ui | |
| # Create the Gradio interface | |
| demo = create_ui(theme_name="Ocean") | |
| # Launch for Hugging Face Spaces | |
| if __name__ == '__main__': | |
| demo.queue().launch( | |
| server_name="0.0.0.0", | |
| server_port=7860, # Hugging Face Spaces default port | |
| share=False # No need for share link on HF Spaces | |
| ) | |