Replace urllib2 code with Requests