title: How to validate a url in Python? (Malformed or not)
body: <p>I have <code>url</code> from the user and I have to reply with the fetched HTML.</p>
  <p>How can I check for the URL to be malformed or not?</p>
  <p>For example :</p>
  <pre><code>url = 'google' # Malformed
  url = 'google.com' # Malformed
  url = 'http://google.com' # Valid
  url = 'http://google' # Malformed
  </code></pre>