firecrawl 1.13.5__tar.gz → 1.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of firecrawl might be problematic. Click here for more details.
- {firecrawl-1.13.5 → firecrawl-1.14.0}/PKG-INFO +1 -1
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl/__init__.py +1 -1
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl/__tests__/e2e_withAuth/test.py +1 -1
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl/__tests__/v1/e2e_withAuth/test.py +2 -2
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl/firecrawl.py +5 -2
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl.egg-info/PKG-INFO +1 -1
- {firecrawl-1.13.5 → firecrawl-1.14.0}/LICENSE +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/README.md +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl/__tests__/e2e_withAuth/__init__.py +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl/__tests__/v1/e2e_withAuth/__init__.py +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl.egg-info/SOURCES.txt +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl.egg-info/dependency_links.txt +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl.egg-info/requires.txt +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/firecrawl.egg-info/top_level.txt +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/pyproject.toml +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/setup.cfg +0 -0
- {firecrawl-1.13.5 → firecrawl-1.14.0}/setup.py +0 -0
|
@@ -37,7 +37,7 @@ def test_scrape_url_invalid_api_key():
|
|
|
37
37
|
# assert "Unexpected error during scrape URL: Status code 403. Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it." in str(excinfo.value)
|
|
38
38
|
|
|
39
39
|
def test_successful_response_with_valid_preview_token():
|
|
40
|
-
app = FirecrawlApp(api_url=API_URL, api_key=
|
|
40
|
+
app = FirecrawlApp(api_url=API_URL, api_key=os.getenv('PREVIEW_TOKEN'), version='v0')
|
|
41
41
|
response = app.scrape_url('https://roastmywebsite.ai')
|
|
42
42
|
assert response is not None
|
|
43
43
|
assert 'content' in response
|
|
@@ -49,7 +49,7 @@ def test_scrape_url_invalid_api_key():
|
|
|
49
49
|
# assert "URL is blocked. Firecrawl currently does not support social media scraping due to policy restrictions." in str(excinfo.value)
|
|
50
50
|
|
|
51
51
|
def test_successful_response_with_valid_preview_token():
|
|
52
|
-
app = FirecrawlApp(api_url=API_URL, api_key=
|
|
52
|
+
app = FirecrawlApp(api_url=API_URL, api_key=os.getenv('PREVIEW_TOKEN'))
|
|
53
53
|
response = app.scrape_url('https://roastmywebsite.ai')
|
|
54
54
|
assert response is not None
|
|
55
55
|
assert "_Roast_" in response['markdown']
|
|
@@ -327,7 +327,7 @@ def test_invalid_api_key_on_map():
|
|
|
327
327
|
# assert "URL is blocked. Firecrawl currently does not support social media scraping due to policy restrictions." in str(excinfo.value)
|
|
328
328
|
|
|
329
329
|
def test_successful_response_with_valid_preview_token_on_map():
|
|
330
|
-
app = FirecrawlApp(api_key=
|
|
330
|
+
app = FirecrawlApp(api_key=os.getenv('PREVIEW_TOKEN'), api_url=API_URL)
|
|
331
331
|
response = app.map_url('https://roastmywebsite.ai')
|
|
332
332
|
assert response is not None
|
|
333
333
|
assert len(response) > 0
|
|
@@ -646,12 +646,12 @@ class FirecrawlApp:
|
|
|
646
646
|
else:
|
|
647
647
|
self._handle_error(response, "check batch scrape errors")
|
|
648
648
|
|
|
649
|
-
def extract(self, urls: List[str], params: Optional[ExtractParams] = None) -> Any:
|
|
649
|
+
def extract(self, urls: Optional[List[str]] = None, params: Optional[ExtractParams] = None) -> Any:
|
|
650
650
|
"""
|
|
651
651
|
Extracts information from a URL using the Firecrawl API.
|
|
652
652
|
|
|
653
653
|
Args:
|
|
654
|
-
urls (List[str]): The URLs to extract information from.
|
|
654
|
+
urls (Optional[List[str]]): The URLs to extract information from.
|
|
655
655
|
params (Optional[ExtractParams]): Additional parameters for the extract request.
|
|
656
656
|
|
|
657
657
|
Returns:
|
|
@@ -662,6 +662,9 @@ class FirecrawlApp:
|
|
|
662
662
|
if not params or (not params.get('prompt') and not params.get('schema')):
|
|
663
663
|
raise ValueError("Either prompt or schema is required")
|
|
664
664
|
|
|
665
|
+
if not urls and not params.get('prompt'):
|
|
666
|
+
raise ValueError("Either urls or prompt is required")
|
|
667
|
+
|
|
665
668
|
schema = params.get('schema')
|
|
666
669
|
if schema:
|
|
667
670
|
if hasattr(schema, 'model_json_schema'):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|