()
| 55 | |
| 56 | @pytest.mark.asyncio |
| 57 | async def test_custom_user_agent(): |
| 58 | async with AsyncWebCrawler(verbose=True) as crawler: |
| 59 | url = "https://www.nbcnews.com/business" |
| 60 | custom_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Crawl4AI/1.0" |
| 61 | result = await crawler.arun(url=url, user_agent=custom_user_agent, bypass_cache=True) |
| 62 | |
| 63 | assert result.success |
| 64 | # Note: We can't directly verify the user agent in the result, but we can check if the crawl was successful |
| 65 | |
| 66 | @pytest.mark.asyncio |
| 67 | async def test_extract_media_and_links(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…