mirror of
https://github.com/mendableai/firecrawl.git
synced 2025-07-24 01:18:33 +00:00
Merge pull request #939 from mendableai/fix/next-check-py-sdk
Fix/while next loop
This commit is contained in:
commit
e485ea7e40
@ -13,7 +13,7 @@ import os
|
||||
|
||||
from .firecrawl import FirecrawlApp # noqa
|
||||
|
||||
__version__ = "1.6.1"
|
||||
__version__ = "1.6.2"
|
||||
|
||||
# Define the logger for the Firecrawl project
|
||||
logger: logging.Logger = logging.getLogger("firecrawl")
|
||||
|
@ -221,12 +221,12 @@ class FirecrawlApp:
|
||||
if status_response.status_code != 200:
|
||||
logger.error(f"Failed to fetch next page: {status_response.status_code}")
|
||||
break
|
||||
status_data = status_response.json()
|
||||
data.extend(status_data.get('data', []))
|
||||
next_data = status_response.json()
|
||||
data.extend(next_data.get('data', []))
|
||||
status_data = next_data
|
||||
except Exception as e:
|
||||
logger.error(f"Error during pagination request: {e}")
|
||||
break
|
||||
status_data.pop('next', None)
|
||||
status_data['data'] = data
|
||||
|
||||
return {
|
||||
@ -430,12 +430,12 @@ class FirecrawlApp:
|
||||
if status_response.status_code != 200:
|
||||
logger.error(f"Failed to fetch next page: {status_response.status_code}")
|
||||
break
|
||||
status_data = status_response.json()
|
||||
data.extend(status_data.get('data', []))
|
||||
next_data = status_response.json()
|
||||
data.extend(next_data.get('data', []))
|
||||
status_data = next_data
|
||||
except Exception as e:
|
||||
logger.error(f"Error during pagination request: {e}")
|
||||
break
|
||||
status_data.pop('next', None)
|
||||
status_data['data'] = data
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user