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

Function test_extract_links

tests/async/test_content_extraction.py:50–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49@pytest.mark.asyncio
50async def test_extract_links():
51 async with AsyncWebCrawler(verbose=True) as crawler:
52 url = "https://www.nbcnews.com/business"
53 result = await crawler.arun(url=url, bypass_cache=True)
54 assert result.success
55 assert result.links
56 links = result.links
57 assert isinstance(links, dict)
58 assert "internal" in links
59 assert "external" in links
60 assert isinstance(links["internal"], list)
61 assert isinstance(links["external"], list)
62 for link in links["internal"] + links["external"]:
63 assert "href" in link
64 assert "text" in link
65
66@pytest.mark.asyncio
67async def test_extract_metadata():

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…