Update API server request object. text_docker file and Readme
This commit is contained in:
@@ -22,7 +22,7 @@ Use the [Crawl4AI GPT Assistant](https://tinyurl.com/crawl4ai-gpt) as your AI-po
|
|||||||
## New in 0.3.73 ✨
|
## New in 0.3.73 ✨
|
||||||
|
|
||||||
- 🐳 Docker Ready: Full API server with seamless deployment & scaling
|
- 🐳 Docker Ready: Full API server with seamless deployment & scaling
|
||||||
- 🎯 Smart Browser: Managed browser integration with CDP support
|
- 🎯 Browser Takeover: Use your own browser with cookies & history intact (CDP support)
|
||||||
- 📝 Mockdown+: Enhanced tag preservation & content extraction
|
- 📝 Mockdown+: Enhanced tag preservation & content extraction
|
||||||
- ⚡️ Parallel Power: Supercharged multi-URL crawling performance
|
- ⚡️ Parallel Power: Supercharged multi-URL crawling performance
|
||||||
- 🌟 And many more exciting updates...
|
- 🌟 And many more exciting updates...
|
||||||
|
|||||||
3
main.py
3
main.py
@@ -62,6 +62,7 @@ class CrawlRequest(BaseModel):
|
|||||||
css_selector: Optional[str] = None
|
css_selector: Optional[str] = None
|
||||||
screenshot: bool = False
|
screenshot: bool = False
|
||||||
magic: bool = False
|
magic: bool = False
|
||||||
|
extra: Optional[Dict[str, Any]] = {}
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class TaskInfo:
|
class TaskInfo:
|
||||||
@@ -251,7 +252,7 @@ class CrawlerService:
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
available_slots = await self.resource_monitor.get_available_slots()
|
available_slots = await self.resource_monitor.get_available_slots()
|
||||||
if available_slots <= 0:
|
if False and available_slots <= 0:
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import os
|
|||||||
from typing import Dict, Any
|
from typing import Dict, Any
|
||||||
|
|
||||||
class Crawl4AiTester:
|
class Crawl4AiTester:
|
||||||
def __init__(self, base_url: str = "http://localhost:8000"):
|
def __init__(self, base_url: str = "http://localhost:11235"):
|
||||||
self.base_url = base_url
|
self.base_url = base_url
|
||||||
|
|
||||||
def submit_and_wait(self, request_data: Dict[str, Any], timeout: int = 300) -> Dict[str, Any]:
|
def submit_and_wait(self, request_data: Dict[str, Any], timeout: int = 300) -> Dict[str, Any]:
|
||||||
@@ -54,8 +54,9 @@ def test_docker_deployment(version="basic"):
|
|||||||
|
|
||||||
# Test cases based on version
|
# Test cases based on version
|
||||||
test_basic_crawl(tester)
|
test_basic_crawl(tester)
|
||||||
if version in ["full", "transformer"]:
|
|
||||||
test_cosine_extraction(tester)
|
# if version in ["full", "transformer"]:
|
||||||
|
# test_cosine_extraction(tester)
|
||||||
|
|
||||||
# test_js_execution(tester)
|
# test_js_execution(tester)
|
||||||
# test_css_selector(tester)
|
# test_css_selector(tester)
|
||||||
|
|||||||
Reference in New Issue
Block a user