fix: Correct proxy configuration for Crawl4AI compatibility

- Changed proxy format from dict to string (http://user:pass@ip:port)
- Updated get_random_proxy() to return Crawl4AI-compatible format
- Replaced deprecated 'proxy' with 'proxy_config' in BrowserConfig
- Fixed test script to handle new proxy format
- Added credential hiding in proxy logging for security

Fixes AttributeError: 'dict' object has no attribute 'strip'
This commit is contained in:
Claude committed 2025-11-30 09:26:02 +00:00
1 parent 2bfda5c421
commit 038dc43b60
2 files changed
+24 -10

No files matched your search

+4 -1
View File
@@ -98,7 +98,10 @@ async def test_anti_detection():
# Test proxy
proxy = get_random_proxy()
if proxy:
logger.info(f"✓ Proxy test: {proxy['server']}")
# Extract just the IP for logging (hide credentials)
proxy_parts = proxy.split('@')
proxy_server = proxy_parts[1] if len(proxy_parts) > 1 else proxy
logger.info(f"✓ Proxy test: {proxy_server}")
else:
logger.warning("⚠️ Pas de proxy configuré")