0

I run the following codes to get some address information, and get the IOError: [Errno socket error] [Errno 10060] when I use the urllib.urlopen() to connect the geo API.

And I can download Json data from the web browser. But can not open the url by Python.

[1]import urllib
[2]import json
[3]serviceurl = 'http://maps.googleapis.com/maps/api/geocode/json?'
[4]address = raw_input('Enter location: ')
Enter location: South Federal University
[5]url = serviceurl + urllib.urlencode({'sensor':'false', 'address': address})
[6]print 'Retrieving', url
Retrieving http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=South+Federal+University
[7]uh = urllib.urlopen(url)

0 Answers0