crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

[Bug]: Cloudflare Verifying is human

Open dchang10 opened this issue 7 months ago • 0 comments

crawl4ai version

0.5.0.post8

Expected Behavior

I am trying to crawl bscscan page. It should be able to wait for the Verifying if Human page, then scrape the page once that's done.

Current Behavior

Currently, it fails to take a screenshot after visiting the page. I referenced the code from other issues, but doesn't seem to work.

`import base64 import os, sys import asyncio, time from crawl4ai import AsyncWebCrawler, CacheMode, CrawlerRunConfig

async def test_news_crawl():

config = CrawlerRunConfig(
            cache_mode=CacheMode.BYPASS,
            remove_overlay_elements=True,
            wait_for_images = True,
            screenshot=True,
        )
async with AsyncWebCrawler(
    headless=True,
    verbose=True,
    user_agent_mode="random",
    user_agent_generator_config={
        "device_type": "mobile",
        "os_type": "android"
    },
) as crawler:
    url = "https://bscscan.com/address/0x0a5F8c6E5367be96c11296b22dd25693654ee48C"       
    result = await crawler.arun(
        url,
        crawler_config=config
    )
    if result.success:
        print(f"Content length: {len(result.markdown)}")
        # Save image in output directory
        with open(f"./output/screenshot_{time.time()}.png", "wb") as f:
            f.write(base64.b64decode(result.screenshot))

if name == "main": asyncio.run(test_news_crawl())`

Is this reproducible?

Yes

Inputs Causing the Bug


Steps to Reproduce


Code snippets


OS

macos

Python version

3.12.6

Browser

No response

Browser version

No response

Error logs & Screenshots (if applicable)

No response

dchang10 avatar Apr 23 '25 16:04 dchang10