From 39b93323ad30ec30f0aee0882b9909bed2eba155 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 25 Jul 2021 12:08:57 +0800 Subject: [PATCH] bugfix --- appPublic/iplocation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appPublic/iplocation.py b/appPublic/iplocation.py index 5e1903d..e31a43d 100644 --- a/appPublic/iplocation.py +++ b/appPublic/iplocation.py @@ -42,7 +42,8 @@ def ipaddress_com(ip): d['lat'] = float(td.contents[0].split(' ')[0]) continue if th.contents[0] == 'IP Country': - d['country'] = td.contents[1].split(' ')[0] + print('ip country:contents[1]=', td.contents[1]) + d['country'] = td.contents[1].split('(')[0].strip() continue if th.contents[0] == 'IP Longitude': d['lon'] = float(td.contents[0].split(' ')[0])