title: Getting the value of href attributes in all <a> tags on a html file with Python
body: <p>I'm building an app in python, and I need to get the URL of all links in one webpage. I already have a function that uses urllib to download the html file from the web, and transform it to a list of strings with readlines().</p>
  
  <p>Currently I have this code that uses regex (I'm not very good at it) to search for links in every line:</p>
  
  <pre><code>for line in lines:
      result = re.match ('/href="(.*)"/iU', line)
      print result
  </code></pre>
  
  <p>This is not working, as it only prints "None" for every line in the file, but I'm sure that at least there are 3 links on the file I'm opening.</p>
  
  <p>Can someone give me a hint on this?</p>
  
  <p>Thanks in advance</p>