title: Is there a better way to write this URL Manipulation in Python?
body: <p>I'm curious if there's a simpler way to remove a particular parameter from a url. What I came up with is the following. This seems a bit verbose. Libraries to use or a more pythonic version appreciated.</p>
  
  <pre><code>parsed = urlparse(url)
  if parsed.query != "":
      params = dict([s.split("=") for s in parsed.query.split("&amp;")])
      if params.get("page"):
          del params["page"]
      url = urlunparse((parsed.scheme,
                        None,
                        parsed.path,
                        None,
                        urlencode(params.items()),
                        parsed.fragment,))
      parsed = urlparse(url)
  </code></pre>