From 781adc21af1f31c3501ae0b88d339d787f4e295f Mon Sep 17 00:00:00 2001 From: rafaelmmiller <150964962+rafaelsideguide@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:10:19 -0300 Subject: [PATCH] fixes while next loop --- apps/python-sdk/firecrawl/__init__.py | 2 +- apps/python-sdk/firecrawl/firecrawl.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/python-sdk/firecrawl/__init__.py b/apps/python-sdk/firecrawl/__init__.py index 270befb2..24a4b00e 100644 --- a/apps/python-sdk/firecrawl/__init__.py +++ b/apps/python-sdk/firecrawl/__init__.py @@ -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") diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py index a973e280..43e940ea 100644 --- a/apps/python-sdk/firecrawl/firecrawl.py +++ b/apps/python-sdk/firecrawl/firecrawl.py @@ -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 {