Merge branch 'develop' of https://github.com/unclecode/crawl4ai into develop

This commit is contained in:
ntohidi
2025-08-12 12:22:25 +08:00
5 changed files with 362 additions and 7 deletions

View File

@@ -91,6 +91,17 @@ async def test_css_selector_extraction():
assert result.markdown
assert all(heading in result.markdown for heading in ["#", "##", "###"])
@pytest.mark.asyncio
async def test_base_tag_link_extraction():
async with AsyncWebCrawler(verbose=True) as crawler:
url = "https://sohamkukreti.github.io/portfolio"
result = await crawler.arun(url=url)
assert result.success
assert result.links
assert isinstance(result.links, dict)
assert "internal" in result.links
assert "external" in result.links
assert any("github.com" in x["href"] for x in result.links["external"])
# Entry point for debugging
if __name__ == "__main__":