-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firecrawl Tool:Expecting value: line 1 column 1 (char 0) #9337
Comments
@louisLiu1004 Hello there! I'm here to assist you with bug fixes, questions, and contributing to the project. Let's work together to resolve any issues you encounter while waiting for a human maintainer. I found a similar discussion regarding the JSON parsing error "Expecting value: line 1 column 1 (char 0)" when using the Firecrawl tool [1]. To resolve this issue, ensure that the server response is not empty before parsing it as JSON. You can modify the def _post_request(self, url, data, headers, retries=3, backoff_factor=0.5):
for attempt in range(retries):
response = requests.post(url, headers=headers, json=data)
if response.status_code == 502:
time.sleep(backoff_factor * (2**attempt))
else:
if response.content: # Check if response is not empty
return response
else:
raise ValueError("Empty response received")
return response
def _get_request(self, url, headers, retries=3, backoff_factor=0.5):
for attempt in range(retries):
response = requests.get(url, headers=headers)
if response.status_code == 502:
time.sleep(backoff_factor * (2**attempt))
else:
if response.content: # Check if response is not empty
return response
else:
raise ValueError("Empty response received")
return response This should help prevent the JSON parsing error by handling cases where the server returns an empty response [2][3]. |
I have the same issue. Currently I use JinaReader instead at this moment. This cloud be related: |
can't reproduce, I also use a self-host firecrawl, it works well |
@hjlarry So any suggestions? |
I think you can try the scrape tool of firecrawl first, because it is simpler than the crawl tool. |
do u self-host firecrawl in your computer or in the service, it works well when i self-hosted in my computer,but once i publish it on the service, it won't work |
dify just send a simple http request to the firecrawl server, so the key point to solve this issue is to check what's the response of this request from dify's api server |
Self Checks
Dify version
0.9.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Using Firecrawl (Self Hosted Docker) to request any website from any node.
✔️ Expected Behavior
Crawl and read the returned webpage content.
❌ Actual Behavior
The text was updated successfully, but these errors were encountered: