#!/usr/bin/env python3 """ Quick verification that Scrapling is properly installed and configured """ import sys import subprocess def check_command(cmd, description): """Check if a command is available""" try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True) if result.returncode == 0: print(f"āœ… {description}") return True else: print(f"āŒ {description}") print(f" Error: {result.stderr.strip()}") return False except Exception as e: print(f"āŒ {description}") print(f" Exception: {e}") return False def main(): print("šŸ” Verifying Scrapling Setup for OpenClaw Integration") print("=" * 55) checks_passed = 0 total_checks = 0 # Check Python total_checks += 1 if check_command("python3 --version", "Python 3 available"): checks_passed += 1 # Check pip total_checks += 1 if check_command("python3 -m pip --version", "pip available"): checks_passed += 1 # Check Scrapling CLI total_checks += 1 if check_command("scrapling --help", "Scrapling CLI available"): checks_passed += 1 # Check fetchers via CLI total_checks += 1 if check_command("scrapling extract stealthy-fetch --help", "Scrapling stealthy-fetch available"): checks_passed += 1 # Check integration script total_checks += 1 if check_command("python3 scrapling-integration.py --help | head -1", "Integration script executable"): checks_passed += 1 # Check test script total_checks += 1 if check_command("./test-scrapling-workflow.sh --help 2>/dev/null || echo 'Script exists'", "Test workflow script exists"): checks_passed += 1 print(f"\nšŸ“Š Results: {checks_passed}/{total_checks} checks passed") if checks_passed == total_checks: print("šŸŽ‰ All checks passed! Scrapling is ready for OpenClaw integration.") print("\nšŸš€ Run the full test suite:") print(" ./test-scrapling-workflow.sh") return 0 else: print("āš ļø Some checks failed. Run installation and try again.") print("\nšŸ”§ Installation:") print(" ./install-scrapling.sh") return 1 if __name__ == "__main__": sys.exit(main())