Modified script from James Tedrick that will run in ArcPro. Only changes the way urllib2 is imported and encodes string to 'utf-8' where urlencode is used.
Also in Py3 dictionary.iteritems() is replaced by dictionary.items()
did not have this in the original post so just open the script and alter...