Coverage for meta_tags_parser/download.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.10.3, created at 2025-08-21 00:51 +0000

1import typing 

2 

3import httpx 

4 

5 

6def download_page_sync(uri_of_page: str) -> str: 

7 """Download page synchronously.""" 

8 return httpx.get(uri_of_page).text 

9 

10 

11async def download_page_async(uri_of_page: str) -> str: 

12 """Download page asynchronously.""" 

13 async with httpx.AsyncClient() as client: 

14 request_obj: typing.Final[httpx.Response] = await client.get(uri_of_page) 

15 return request_obj.text 

16 

17