Removes any existing fragment from URL. Returns a tuple of the defragmented URL and the fragment. If the URL contained no fragments, the second element is the empty string or None if missing_as_none is True.
urllib.parse/urldefrag
urldefrag