Validate if the given string is a valid URL.
(url: str)
| 155 | await browser.close() |
| 156 | |
| 157 | def validate_url(url: str) -> bool: |
| 158 | """Validate if the given string is a valid URL.""" |
| 159 | try: |
| 160 | result = urlparse(url) |
| 161 | return all([result.scheme, result.netloc]) |
| 162 | except: |
| 163 | return False |
| 164 | |
| 165 | def main(): |
| 166 | parser = argparse.ArgumentParser(description='Fetch and extract text content from webpages.') |
no outgoing calls