Files
gogo2/run_mexc_browser.py
2025-06-24 12:59:28 +03:00

52 lines
1.6 KiB
Python

#!/usr/bin/env python3
"""
One-Click MEXC Browser Launcher
Simply run this script to start capturing MEXC futures trading requests.
"""
import sys
import os
# Add project root to path
project_root = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, project_root)
def main():
"""Launch MEXC browser automation"""
print("🚀 MEXC Futures Request Interceptor")
print("=" * 50)
print("This will automatically:")
print("✅ Install ChromeDriver")
print("✅ Open MEXC futures page")
print("✅ Capture all API requests")
print("✅ Extract session cookies")
print("✅ Save data to JSON files")
print("\nRequirements will be installed automatically if missing.")
try:
# First try to run the auto browser directly
from core.mexc_webclient.auto_browser import main as run_auto_browser
run_auto_browser()
except ImportError as e:
print(f"\n⚠️ Import error: {e}")
print("Installing requirements first...")
# Try to install requirements and run setup
try:
from setup_mexc_browser import main as setup_main
setup_main()
except ImportError:
print("❌ Could not find setup script")
print("Please run: pip install selenium webdriver-manager")
except Exception as e:
print(f"❌ Error: {e}")
print("\nTroubleshooting:")
print("1. Make sure you have Chrome browser installed")
print("2. Check your internet connection")
print("3. Try running: pip install selenium webdriver-manager")
if __name__ == "__main__":
main()