[Bug]: Sample Colab is not longer working in the version 0.6.3
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:
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
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
-
Replace
markdown_v2withmarkdown- This applies to multiple cells throughout the notebook.
-
Section 7: "Using Hooks for Custom Workflow"
- Missing imports:
from playwright.async_api import BrowserContext from playwright.async_api import Page - Also,
markdown_v2is used here and should be replaced withmarkdown.
- Missing imports:
-
LLM Extraction Section
extraction_strategyandcache_modeare passed directly toarun, which is no longer supported.- These should now be passed via a properly constructed
CrawlerRunConfig.
Fixed, all examples in colab work now.