crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

how to pass raw html to LLMExtractionStrategy?

Open prorid3r opened this issue 1 year ago • 1 comments

Discussed in https://github.com/unclecode/crawl4ai/discussions/589

Originally posted by prorid3r January 30, 2025 Hi! In chapter 7 of https://crawl4ai.com/mkdocs/extraction/llm-strategies/ one of the possible format to pass is: "html: The cleaned HTML or raw HTML (depending on your crawler config) goes into the LLM." Can you please help me to understand when clean or raw HTML gets passed to LLM extractor? I couldnt quite find it clearly explained in the documentation.

prorid3r avatar Jan 30 '25 12:01 prorid3r

Is this the information you are looking for?

https://docs.crawl4ai.com/core/local-files/

raw_html = f"raw:{html}"
result = await crawler.arun(url=raw_html, config=config)

matheus-rossi avatar Jan 30 '25 18:01 matheus-rossi