svlipatov
commited on
Update coordinates wikipedia_api.py
Browse files- wikipedia_api.py +4 -7
wikipedia_api.py
CHANGED
@@ -17,13 +17,10 @@ def getWikipedia(pList):
|
|
17 |
if not get is None:
|
18 |
|
19 |
summary = wikipedia.summary(get[0])
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
if not find is None:
|
25 |
-
latitude = find['data-lat']
|
26 |
-
longitude = find['data-lon']
|
27 |
else:
|
28 |
summary = 'Ничего не найдено'
|
29 |
|
|
|
17 |
if not get is None:
|
18 |
|
19 |
summary = wikipedia.summary(get[0])
|
20 |
+
try:
|
21 |
+
latitude = wikipedia.page(get[0]).coordinates[0]
|
22 |
+
longitude = wikipedia.page(get[0]).coordinates[1]
|
23 |
+
except KeyError: 'coordinates'
|
|
|
|
|
|
|
24 |
else:
|
25 |
summary = 'Ничего не найдено'
|
26 |
|