import urllib.request, urllib.error, urllib.parse
opener = urllib.request.build_opener()
opener.addheaders.append(('Cookie', 'cookiename=cookievalue'))
f = opener.open('http://example.com/')
urllib2 с куками