migrate from urllib2 to requests in the connect.py module.