Fetch a page and return its HTML content.
(url: str, timeout: float = 30.0)
| 29 | |
| 30 | @retry(stop=stop_after_attempt(3), wait=wait_exponential(min=2, max=30)) |
| 31 | async def fetch_page(url: str, timeout: float = 30.0) -> Optional[str]: |
| 32 | """Fetch a page and return its HTML content.""" |
| 33 | async with httpx.AsyncClient(headers=_HEADERS, follow_redirects=True) as client: |
| 34 | resp = await client.get(url, timeout=timeout) |
| 35 | resp.raise_for_status() |
| 36 | return resp.text |
| 37 | |
| 38 | |
| 39 | def extract_text(html: str) -> str: |