feat(profiles): add CLI command for crawling with browser profiles

Adds new functionality to crawl websites using saved browser profiles directly from the CLI.
This includes:
- New CLI option to use profiles for crawling
- Helper functions for profile-based crawling
- Fixed type hints for config parameters
- Updated example to show browser window by default

This makes it easier for users to leverage saved browser profiles for crawling without writing code.
This commit is contained in:
UncleCode
2025-03-02 21:33:33 +08:00
parent 95175cb394
commit c612f9a852
4 changed files with 87 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ async def crawl_with_profile(profile_path, url):
# Create browser config with the profile path
browser_config = BrowserConfig(
headless=True, # Set to False if you want to see the browser window
headless=False, # Set to False if you want to see the browser window
use_managed_browser=True, # Required for persistent profiles
user_data_dir=profile_path
)