from urllib.parse import urljoin, urlparse def remove_queries_from_url(url: str) -> str: parsed_url = urlparse(url) return urljoin(url, parsed_url.path)