Verify URL exists from file
<p>So I have some code that I use to scrape through my mailbox looking for certain URL's.  Once this is completed it creates a file called links.txt </p>

<p>I want to run a script against that file to get an output of all the current URL's that are live in that list. The script I have only allows for me to check on URL at a time</p>

<pre><code>import urllib2

for url in ["www.google.com"]:

    try:
        connection = urllib2.urlopen(url)
        print connection.getcode()
        connection.close()
    except urllib2.HTTPError, e:
        print e.getcode()
</code></pre>
