Use urllib2 methods to get protocol, rather than string comparison