MCPcopy
hub / github.com/unclecode/crawl4ai / test_css_selector

Function test_css_selector

tests/async/test_parameters_and_options.py:23–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22@pytest.mark.asyncio
23async def test_css_selector():
24 async with AsyncWebCrawler(verbose=True) as crawler:
25 url = "https://www.nbcnews.com/business"
26 css_selector = "h1, h2, h3"
27 result = await crawler.arun(url=url, css_selector=css_selector, bypass_cache=True)
28
29 assert result.success
30 assert "<h1" in result.cleaned_html or "<h2" in result.cleaned_html or "<h3" in result.cleaned_html
31
32@pytest.mark.asyncio
33async def test_javascript_execution():

Callers

nothing calls this directly

Calls 2

AsyncWebCrawlerClass · 0.90
arunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…