crawl4ai
crawl4ai copied to clipboard
[Bug]: crwl -b fail
crawl4ai version
0.6.1
Expected Behavior
Crawl4AI CLI work using -b parameter
Current Behavior
Is this reproducible?
Yes
Inputs Causing the Bug
Steps to Reproduce
Code snippets
OS
windows
Python version
Python 3.12.6
Browser
No response
Browser version
No response
Error logs & Screenshots (if applicable)
No response
Root cause
Looking at the code, there are two options both using -b as their shorthand:
@click.option("--browser", "-b", ...)
@click.option("--bypass-cache", "-b", is_flag=True, ...)
When Click sees -b, it can't tell which one you mean. Since --bypass-cache is a flag that doesn't take a value, it treats everything after -b as an unexpected argument.
Suggestions
Change one of the shorthands to something else:
# Either this:
@click.option("--bypass-cache", "-bc", is_flag=True, ...)
# Or this:
@click.option("--browser", "-br", ...)
@lisuwei As you can see the error is result of a conflicting shorthand "-b" between "--browser" and "--bypass-cache". We'll fix it in the next release. In the meantime use the full form.
crwl https://example.com --browser "headless=true,viewport_width=1280,user_agent_mode=random"