()
| 12 | |
| 13 | @pytest.mark.asyncio |
| 14 | async def test_custom_user_agent(): |
| 15 | async with AsyncWebCrawler(verbose=True) as crawler: |
| 16 | custom_user_agent = "MyCustomUserAgent/1.0" |
| 17 | crawler.crawler_strategy.update_user_agent(custom_user_agent) |
| 18 | url = "https://httpbin.org/user-agent" |
| 19 | result = await crawler.arun(url=url, bypass_cache=True) |
| 20 | assert result.success |
| 21 | assert custom_user_agent in result.html |
| 22 | |
| 23 | @pytest.mark.asyncio |
| 24 | async def test_custom_headers(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…