wandergis/coordTransform_py

Python3 urllib报错

Opened this issue · 0 comments

AttributeError: module 'urllib' has no attribute 'urlencode'
AttributeError: module 'urllib' has no attribute 'parse'

Do as follows
import urllib.parse
import urllib.request
geocoding = urllib.parse.urlencode(geocoding)
ret = urllib.request.urlopen("%s?%s" % ("http://restapi.amap.com/v3/geocode/geo", geocoding))
Works.