firecrawl 1.6.0__tar.gz → 1.6.2__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.6.0 → firecrawl-1.6.2}/PKG-INFO +1 -1
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl/__init__.py +1 -1
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl/firecrawl.py +12 -15
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl.egg-info/PKG-INFO +1 -1
- {firecrawl-1.6.0 → firecrawl-1.6.2}/LICENSE +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/README.md +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl/__tests__/e2e_withAuth/__init__.py +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl/__tests__/e2e_withAuth/test.py +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl/__tests__/v1/e2e_withAuth/__init__.py +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl/__tests__/v1/e2e_withAuth/test.py +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl.egg-info/SOURCES.txt +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl.egg-info/dependency_links.txt +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl.egg-info/requires.txt +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/firecrawl.egg-info/top_level.txt +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/pyproject.toml +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/setup.cfg +0 -0
- {firecrawl-1.6.0 → firecrawl-1.6.2}/setup.py +0 -0
|
@@ -39,13 +39,6 @@ class FirecrawlApp:
|
|
|
39
39
|
data: Optional[Any] = None
|
|
40
40
|
error: Optional[str] = None
|
|
41
41
|
|
|
42
|
-
class ErrorResponse(pydantic.BaseModel):
|
|
43
|
-
"""
|
|
44
|
-
Error response.
|
|
45
|
-
"""
|
|
46
|
-
success: bool
|
|
47
|
-
error: str
|
|
48
|
-
|
|
49
42
|
def __init__(self, api_key: Optional[str] = None, api_url: Optional[str] = None) -> None:
|
|
50
43
|
"""
|
|
51
44
|
Initialize the FirecrawlApp instance with API key, API URL.
|
|
@@ -228,12 +221,12 @@ class FirecrawlApp:
|
|
|
228
221
|
if status_response.status_code != 200:
|
|
229
222
|
logger.error(f"Failed to fetch next page: {status_response.status_code}")
|
|
230
223
|
break
|
|
231
|
-
|
|
232
|
-
data.extend(
|
|
224
|
+
next_data = status_response.json()
|
|
225
|
+
data.extend(next_data.get('data', []))
|
|
226
|
+
status_data = next_data
|
|
233
227
|
except Exception as e:
|
|
234
228
|
logger.error(f"Error during pagination request: {e}")
|
|
235
229
|
break
|
|
236
|
-
status_data.pop('next', None)
|
|
237
230
|
status_data['data'] = data
|
|
238
231
|
|
|
239
232
|
return {
|
|
@@ -437,12 +430,12 @@ class FirecrawlApp:
|
|
|
437
430
|
if status_response.status_code != 200:
|
|
438
431
|
logger.error(f"Failed to fetch next page: {status_response.status_code}")
|
|
439
432
|
break
|
|
440
|
-
|
|
441
|
-
data.extend(
|
|
433
|
+
next_data = status_response.json()
|
|
434
|
+
data.extend(next_data.get('data', []))
|
|
435
|
+
status_data = next_data
|
|
442
436
|
except Exception as e:
|
|
443
437
|
logger.error(f"Error during pagination request: {e}")
|
|
444
438
|
break
|
|
445
|
-
status_data.pop('next', None)
|
|
446
439
|
status_data['data'] = data
|
|
447
440
|
|
|
448
441
|
return {
|
|
@@ -460,7 +453,7 @@ class FirecrawlApp:
|
|
|
460
453
|
self._handle_error(response, 'check batch scrape status')
|
|
461
454
|
|
|
462
455
|
|
|
463
|
-
def extract(self, urls: List[str], params: Optional[ExtractParams] = None) ->
|
|
456
|
+
def extract(self, urls: List[str], params: Optional[ExtractParams] = None) -> Any:
|
|
464
457
|
"""
|
|
465
458
|
Extracts information from a URL using the Firecrawl API.
|
|
466
459
|
|
|
@@ -493,7 +486,11 @@ class FirecrawlApp:
|
|
|
493
486
|
headers
|
|
494
487
|
)
|
|
495
488
|
if response.status_code == 200:
|
|
496
|
-
|
|
489
|
+
data = response.json()
|
|
490
|
+
if data['success']:
|
|
491
|
+
return data
|
|
492
|
+
else:
|
|
493
|
+
raise Exception(f'Failed to extract. Error: {data["error"]}')
|
|
497
494
|
else:
|
|
498
495
|
self._handle_error(response, "extract")
|
|
499
496
|
except Exception as e:
|
|
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
|
|
File without changes
|
|
File without changes
|