from urllib.parse import urlparse, parse_qs def extract_query_params(url): parsed_url = urlparse(url) return parse_qs(parsed_url.query)