Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crawl4ai/async_webcrawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ async def arun(
screenshot=True,
...
)
result = await crawler.arun(url="https://example.com", crawler_config=config)
result = await crawler.arun(url="https://example.com", config=config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

🧩 Analysis chain

Docstring example fix matches the API. LGTM.

The example now correctly uses config=config and aligns with the arun signature.

Run this to catch any remaining references to the old name in docs/comments:


🏁 Script executed:

#!/bin/bash
rg -n --hidden -S -C2 '\bcrawler_config\b'

Length of output: 165130


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) All occurrences of the token 'crawler_config=' (kwarg or assignment):"
rg -n --hidden -S -C2 '\bcrawler_config\s*=' || true

echo
echo "2) Calls using 'crawler_config=' as a keyword argument (arun / arun_many / crawl / client.crawl):"
rg -n --hidden -S -C2 -P 'arun\([^)]*\bcrawler_config\s*=' || true
rg -n --hidden -S -C2 -P 'arun_many\([^)]*\bcrawler_config\s*=' || true
rg -n --hidden -S -C2 -P '\bcrawl\([^)]*\bcrawler_config\s*=' || true

echo
echo "3) JSON/dict keys named 'crawler_config':"
rg -n --hidden -S -C2 '"?crawler_config"?:' || true

Length of output: 114100


LGTM — docstring example updated; fix remaining docs using legacy 'crawler_config' kwarg

crawl4ai/async_webcrawler.py example matches arun(config=...). Update remaining examples that pass crawler_config= to use config= — notably deploy/docker/c4ai-code-context.md:1578 (change crawler.arun(..., crawler_config=config) → crawler.arun(..., config=config)).

🤖 Prompt for AI Agents
In crawl4ai/async_webcrawler.py around line 228, the example call uses the new
keyword name config (result = await crawler.arun(url="https://example.com",
config=config)); update any remaining examples that still use the legacy
crawler_config keyword to instead pass config, e.g., change crawler.arun(...,
crawler_config=config) → crawler.arun(..., config=config) in
deploy/docker/c4ai-code-context.md at or near line 1578 and any other docs or
examples across the repo so all usages are consistent.


Args:
url: The URL to crawl (http://, https://, file://, or raw:)
crawler_config: Configuration object controlling crawl behavior
config: Configuration object controlling crawl behavior
[other parameters maintained for backwards compatibility]

Returns:
Expand Down Expand Up @@ -849,4 +849,4 @@ async def aseed_urls(
seeding_config
)
else:
raise ValueError("`domain_or_domains` must be a string or a list of strings.")
raise ValueError("`domain_or_domains` must be a string or a list of strings.")