Ensure URL is properly formatted. Args: url: Input URL Returns: Fixed URL
(url: str)
| 42 | return element.text or "" |
| 43 | |
| 44 | def fix_url(url: str) -> str: |
| 45 | """ |
| 46 | Ensure URL is properly formatted. |
| 47 | |
| 48 | Args: |
| 49 | url: Input URL |
| 50 | |
| 51 | Returns: |
| 52 | Fixed URL |
| 53 | """ |
| 54 | if not url: |
| 55 | return "" |
| 56 | |
| 57 | url = url.strip() |
| 58 | |
| 59 | # Add missing scheme if needed |
| 60 | if url and not (url.startswith('http://') or url.startswith('https://')): |
| 61 | if url.startswith('//'): |
| 62 | url = 'https:' + url |
| 63 | else: |
| 64 | url = 'https://' + url |
| 65 | |
| 66 | return url |
| 67 | |
| 68 | def extract_duration(duration_str: str) -> str | None: |
| 69 | """ |
no outgoing calls
no test coverage detected