Modified to use urllib2 instead of urllib.