Not showing crawled Title in datasets #4181

Closed
opened 2026-02-21 18:05:05 -05:00 by yindo · 3 comments
Owner

Originally created by @AndyMik90 on GitHub (Jun 19, 2024).

Originally assigned to: @takatost on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.11

Cloud or Self Hosted

Cloud, Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

Scrape any site with firecrawl in datasets
CleanShot 2024-06-19 at 13 47 42

✔️ Expected Behavior

Retrieve title of the pages

Actual Behavior

Shows up without Title

Originally created by @AndyMik90 on GitHub (Jun 19, 2024). Originally assigned to: @takatost on GitHub. ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.11 ### Cloud or Self Hosted Cloud, Self Hosted (Docker), Self Hosted (Source) ### Steps to reproduce Scrape any site with firecrawl in datasets ![CleanShot 2024-06-19 at 13 47 42](https://github.com/langgenius/dify/assets/119136210/325e1069-4759-48d6-8a38-9daff9436b07) ### ✔️ Expected Behavior Retrieve title of the pages ### ❌ Actual Behavior Shows up without Title
yindo added the 🐞 bug label 2026-02-21 18:05:05 -05:00
yindo closed this issue 2026-02-21 18:05:05 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 19, 2024):

To resolve the issue where the crawled titles are not showing up in datasets when using Firecrawl in Dify version 0.6.11, follow these steps:

  1. Configure Firecrawl with an API Key:

    • Go to the Firecrawl configuration section.
    • Enter the API key obtained from firecrawl.dev. The API key should start with "fc-".
  2. Ensure Firecrawl is Configured:

    • If Firecrawl is not configured, you will see a message indicating that it is not configured. Follow the instructions to configure it.
  3. Verify Crawled Data:

    • Ensure that the crawled data includes titles. You can check the mock crawl result to see the expected structure of the data.
  4. Check the Extraction Process:

    • Ensure that the extraction process in FirecrawlWebExtractor is correctly set up to include titles. The extract method should properly handle the crawled data and include the title in the metadata.

Here is the relevant part of the FirecrawlWebExtractor class:

class FirecrawlWebExtractor(BaseExtractor):
    def extract(self) -> list[Document]:
        """Extract content from the URL."""
        documents = []
        if self.mode == 'crawl':
            crawl_data = WebsiteService.get_crawl_url_data(self.job_id, 'firecrawl', self._url, self.tenant_id)
            if crawl_data is None:
                return []
            document = Document(page_content=crawl_data.get('markdown', ''),
                                metadata={
                                    'source_url': crawl_data.get('source_url'),
                                    'description': crawl_data.get('description'),
                                    'title': crawl_data.get('title')
                                }
                                )
            documents.append(document)
        elif self.mode == 'scrape':
            scrape_data = WebsiteService.get_scrape_url_data('firecrawl', self._url, self.tenant_id,
                                                             self.only_main_content)
            document = Document(page_content=scrape_data.get('markdown', ''),
                                metadata={
                                    'source_url': scrape_data.get('source_url'),
                                    'description': scrape_data.get('description'),
                                    'title': scrape_data.get('title')
                                }
                                )
            documents.append(document)
        return documents

By ensuring that Firecrawl is properly configured with the correct API key, verifying that the crawled data includes titles, and checking that the extraction process is correctly set up to include titles, the crawled titles should start showing up in your datasets [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 19, 2024): <!-- Answer --> To resolve the issue where the crawled titles are not showing up in datasets when using Firecrawl in Dify version 0.6.11, follow these steps: 1. **Configure Firecrawl with an API Key**: - Go to the Firecrawl configuration section. - Enter the API key obtained from `firecrawl.dev`. The API key should start with "fc-". 2. **Ensure Firecrawl is Configured**: - If Firecrawl is not configured, you will see a message indicating that it is not configured. Follow the instructions to configure it. 3. **Verify Crawled Data**: - Ensure that the crawled data includes titles. You can check the mock crawl result to see the expected structure of the data. 4. **Check the Extraction Process**: - Ensure that the extraction process in `FirecrawlWebExtractor` is correctly set up to include titles. The `extract` method should properly handle the crawled data and include the title in the metadata. Here is the relevant part of the `FirecrawlWebExtractor` class: ```py class FirecrawlWebExtractor(BaseExtractor): def extract(self) -> list[Document]: """Extract content from the URL.""" documents = [] if self.mode == 'crawl': crawl_data = WebsiteService.get_crawl_url_data(self.job_id, 'firecrawl', self._url, self.tenant_id) if crawl_data is None: return [] document = Document(page_content=crawl_data.get('markdown', ''), metadata={ 'source_url': crawl_data.get('source_url'), 'description': crawl_data.get('description'), 'title': crawl_data.get('title') } ) documents.append(document) elif self.mode == 'scrape': scrape_data = WebsiteService.get_scrape_url_data('firecrawl', self._url, self.tenant_id, self.only_main_content) document = Document(page_content=scrape_data.get('markdown', ''), metadata={ 'source_url': scrape_data.get('source_url'), 'description': scrape_data.get('description'), 'title': scrape_data.get('title') } ) documents.append(document) return documents ``` By ensuring that Firecrawl is properly configured with the correct API key, verifying that the crawled data includes titles, and checking that the extraction process is correctly set up to include titles, the crawled titles should start showing up in your datasets <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/i18n/hi-IN/dataset-creation.ts)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/i18n/en-US/dataset-creation.ts)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/datasets/create/website/firecrawl/mock-crawl-result.ts)</sup><sup>[[4]](https://github.com/langgenius/dify/blob/main/api/core/rag/extractor/firecrawl/firecrawl_web_extractor.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@JohnJyong commented on GitHub (Jun 20, 2024):

image
the title is not returned by Firecrawl, maybe you can try other urls

@JohnJyong commented on GitHub (Jun 20, 2024): ![image](https://github.com/langgenius/dify/assets/76649700/4431da7c-5494-4578-9974-4230124af12c) the title is not returned by Firecrawl, maybe you can try other urls
Author
Owner

@nickscamara commented on GitHub (Jun 25, 2024):

Hey @AndyMik90, It was indeed something in Firecrawl's end. Just pushed a fix and it should be returning all the metadata now including the title. Thank you!

@nickscamara commented on GitHub (Jun 25, 2024): Hey @AndyMik90, It was indeed something in Firecrawl's end. Just pushed a fix and it should be returning all the metadata now including the title. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4181