Get all URLs on a Page Python
<p>I'm working on something that requires me to get all the URLs on a page. It seems to work on most websites I've tested, for example microsoft.com, but it only returns three from google.com. Here is the relevant source code:</p>

<pre><code>
   import urllib
   import time
   import re
   fwcURL = "http://www.microsoft.com" #URL to read
   mylines = urllib.urlopen(fwcURL).readlines()
   print "Found URLs:"
   time.sleep(1) #Pause execution for a bit
   for item in mylines:
     if "http://" in item.lower(): #For http
       print item[item.index("http://"):].split("'")[0].split('"')[0] # Remove ' and " from the end, for example in href=
     if "https://" in item.lower(): #For https
       print item[item.index("https://"):].split("'")[0].split('"')[0] # Ditto
</code></pre>

<p>If my code can be improved, or if there is a better way to do this, please respond. Thanks in advance!</p>
