adopt urllib2 for python3
rename unicode to str for python3