Core browser automation framework for Ask Gloom. Provides a high-level interface for browser control, profile management, and automation tasks.
- Simplified browser automation with intelligent recovery
- Advanced profile management and persistence
- Flexible configuration system
- Screenshot and visual comparison capabilities
- Automatic driver management and updates
- Comprehensive error handling and logging
- Cross-platform support (Windows, Linux, macOS)
pip install gloom-core
Basic browser automation:
from askgloom.core import Browser
# Initialize and use browser with context manager
with Browser() as browser:
browser.navigate("https://crate.lol")
browser.screenshot("homepage.png")
# Get page content
title = browser.get_element_text("h1.title")
print(f"Page title: {title}")
Custom profile configuration:
from askgloom.core import Profile, Browser
# Create custom profile
profile = Profile("my_profile")
profile.preferences.update({
"browser": {
"window_size": {"width": 1920, "height": 1080},
"user_agent": "Custom User Agent",
"download_path": "/custom/download/path"
}
})
profile.save_preferences()
# Use profile with browser
with Browser(profile=profile) as browser:
browser.navigate("https://crate.lol")
Advanced configuration:
from askgloom.core import Config, Browser
# Configure browser behavior
config = Config()
config.set("browser.headless", True)
config.set("automation.retry_attempts", 5)
config.set("automation.screenshot_on_error", True)
# Use configuration
browser = Browser(options=config.get("browser"))
For detailed documentation, visit crate.lol/docs
# Clone the repository
git clone https://github.com/ask-gloom/gloom-core.git
cd gloom-core
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=askgloom
# Run specific test category
pytest tests/test_browser.py -v
# Format code
black askgloom tests
isort askgloom tests
# Type checking
mypy askgloom
# Lint
flake8 askgloom tests
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Visit our website: crate.lol