crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

[Bug]: Sample Colab is not longer working in the version 0.6.3

Open seagomezar opened this issue 1 year ago • 2 comments

crawl4ai version

0.6.3

Expected Behavior

The sample colab provided in the readme is no longer working with version 0.6.3, used to work with version 0.4.x but after the upgrade the following errors are appearing:

Image

Current Behavior

Cells in the colab after the installation are showing markdown and general errors. See the example.

Is this reproducible?

Yes

Inputs Causing the Bug

https://colab.research.google.com/drive/1SgRPrByQLzjRfwoRNq1wSGE9nYY_EE8C

Steps to Reproduce

1. Go to the colab
2. Run all cells
3. 5 and forward cells are failing

Code snippets


OS

Colab

Python version

3.13

Browser

No response

Browser version

No response

Error logs & Screenshots (if applicable)

[INIT].... → Crawl4AI 0.6.3 [FETCH]... ↓ https://www.kidocode.com/degrees/technology | ✓ | ⏱: 2.56s [SCRAPE].. ◆ https://www.kidocode.com/degrees/technology | ✓ | ⏱: 0.12s [COMPLETE] ● https://www.kidocode.com/degrees/technology | ✓ | ⏱: 2.69s

AttributeError Traceback (most recent call last) /tmp/ipython-input-17-3707031533.py in <cell line: 0>() 14 print(result.markdown_v2.raw_markdown[:500].replace("\n", " -- ")) # Print the first 500 characters 15 ---> 16 asyncio.run(simple_crawl())

7 frames /usr/local/lib/python3.11/dist-packages/crawl4ai/models.py in markdown_v2(self) 207 deprecated and they should use 'markdown' instead. 208 """ --> 209 raise AttributeError( 210 "The 'markdown_v2' attribute is deprecated and has been removed. " 211 """Please use 'markdown' instead, which now returns a MarkdownGenerationResult, with

AttributeError: The 'markdown_v2' attribute is deprecated and has been removed. Please use 'markdown' instead, which now returns a MarkdownGenerationResult, with following properties: - raw_markdown: The raw markdown string - markdown_with_citations: The markdown string with citations - references_markdown: The markdown string with references - fit_markdown: The markdown string with fit text

seagomezar avatar Jun 26 '25 00:06 seagomezar

Hi, thanks for flagging this. Just noting for visibility:

The current Google Colab notebook was originally built for crawl4ai v0.4.3, and several methods used in it are now deprecated as of v0.7.x.

Required Updates

  1. Replace markdown_v2 with markdown

    • This applies to multiple cells throughout the notebook.
  2. Section 7: "Using Hooks for Custom Workflow"

    • Missing imports:
      from playwright.async_api import BrowserContext
      from playwright.async_api import Page
      
    • Also, markdown_v2 is used here and should be replaced with markdown.
  3. LLM Extraction Section

    • extraction_strategy and cache_mode are passed directly to arun, which is no longer supported.
    • These should now be passed via a properly constructed CrawlerRunConfig.

SohamKukreti avatar Aug 03 '25 13:08 SohamKukreti

Fixed, all examples in colab work now.

SohamKukreti avatar Aug 11 '25 12:08 SohamKukreti