X-Git-Url: https://git.rvb.name/pyrungps.git/blobdiff_plain/d2651ad4f9981d3e21c5f10fdef0a520d0f2d42d..1690b8b7c8ccfdf60be2b33b314e6c26bdef86e6:/pyosmname.py?ds=sidebyside diff --git a/pyosmname.py b/pyosmname.py index a0ee16f..e6dc29e 100644 --- a/pyosmname.py +++ b/pyosmname.py @@ -8,7 +8,10 @@ from lxml import etree def GetXMLDescr(lat,lon): - req = urllib2.Request("http://nominatim.openstreetmap.org/reverse?lat=%s&lon=%s&accept-language=ru,en" %(lat,lon), None) + reqstr = "http://nominatim.openstreetmap.org/reverse?lat=%s&lon=%s&accept-language=ru,en" %(lat,lon) + print reqstr + headers = { 'User-Agent' : 'PyRunGPS/1.0', 'Referer' : 'https://maps.rvb.name' } + req = urllib2.Request(reqstr, None, headers) page = urllib2.urlopen(req).read() return etree.fromstring(page)