unclecode / crawl4ai

🔥🕷️ Crawl4AI: Open-source LLM Friendly Web Crawler & Scrapper
Apache License 2.0
15.61k stars 1.13k forks source link

AsyncWebCrawler returns arrays of JSON objects instead of single objects per scrape #205

Open Udbhav8 opened 1 week ago

Udbhav8 commented 1 week ago

Description

The AsyncWebCrawler is currently returning arrays of JSON objects for each scrape, even when a Pydantic schema and prompt are specified to return only one JSON object per scrape. This behavior is causing issues in our data processing pipeline and needs to be addressed.

Current Behavior

Expected Behavior

Steps to Reproduce

  1. Set up an AsyncWebCrawler instance with a specified Pydantic schema.
  2. Provide a prompt that clearly states to return a single JSON object.
  3. Perform a scrape operation on a target URL.
  4. Observe that the returned result is an array of JSON objects instead of a single object.
unclecode commented 3 days ago

Can you show me a sample of the code you're running? I'm currently testing it and I'd appreciate it if you shared your code so I can review it.