poi icon indicating copy to clipboard operation
poi copied to clipboard

爬取单个城市数据中的app.py报错

Open zhaozhongguo95 opened this issue 5 years ago • 5 comments

# 根据城市名称和分类关键字获取poi数据 def getpois(cityname, keywords): i = 1 poilist = [] while True: # 使用while循环不断分页获取数据 result = getpoi_page(cityname, keywords, i) print(result) result = json.loads(result) # 将字符串转换为json print(result) if result['count'] == '0': break hand(poilist, result) i = i + 1 return poilist

字符串转换为json后没有count,并报错KeyError 'count'

zhaozhongguo95 avatar Jan 11 '20 09:01 zhaozhongguo95

这个一般是你的密钥申请错了哦,注意一定要是web服务类型的

---原始邮件--- 发件人: "CrazyZ"<[email protected]> 发送时间: 2020年1月11日(周六) 下午5:28 收件人: "liujiao111/poi"<[email protected]>; 抄送: "Subscribed"<[email protected]>; 主题: [liujiao111/poi] 爬取单个城市数据中的app.py报错 (#1)

根据城市名称和分类关键字获取poi数据 def getpois(cityname, keywords): i = 1 poilist = [] while True: # 使用while循环不断分页获取数据 result = getpoi_page(cityname, keywords, i) print(result) result = json.loads(result) # 将字符串转换为json print(result) if result['count'] == '0': break hand(poilist, result) i = i + 1 return poilist

字符串转换为json后没有count,并报错KeyError 'count'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

liujiao111 avatar Jan 11 '20 09:01 liujiao111

    首先,感谢你的回复,前面的问题已经解决!但并不是因为密匙的问题,可能与我的分类高德编码有关(我选择的所有)。 不过,我在点转shp时,有报错。同样的我在你的原始代码中,以衡阳为例,出现同样的错误! 希望能解答一下,谢谢。

------------------ 原始邮件 ------------------ 发件人: "liujiao"<[email protected]>; 发送时间: 2020年1月11日(星期六) 下午5:35 收件人: "liujiao111/poi"<[email protected]>; 抄送: "呜呼哀哉"<[email protected]>;"Author"<[email protected]>; 主题: Re: [liujiao111/poi] 爬取单个城市数据中的app.py报错 (#1)

这个一般是你的密钥申请错了哦,注意一定要是web服务类型的

---原始邮件--- 发件人: "CrazyZ"<[email protected]&gt; 发送时间: 2020年1月11日(周六) 下午5:28 收件人: "liujiao111/poi"<[email protected]&gt;; 抄送: "Subscribed"<[email protected]&gt;; 主题: [liujiao111/poi] 爬取单个城市数据中的app.py报错 (#1)

根据城市名称和分类关键字获取poi数据 def getpois(cityname, keywords): i = 1 poilist = [] while True: # 使用while循环不断分页获取数据 result = getpoi_page(cityname, keywords, i) print(result) result = json.loads(result) # 将字符串转换为json print(result) if result['count'] == '0': break hand(poilist, result) i = i + 1 return poilist

字符串转换为json后没有count,并报错KeyError 'count'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhaozhongguo95 avatar Jan 11 '20 11:01 zhaozhongguo95

图片 我的似乎也出现了类似错误;之前采集没出现过这个情况

zuoqiuan avatar Jun 09 '20 12:06 zuoqiuan

这个问题已经修复了哈,请更新代码就可以

liujiao111 avatar Jun 23 '20 00:06 liujiao111

这个问题已经修复了哈,请更新代码就可以了

QQ截图20210705185807 我用新的也出现了类似的问题

yahaha115 avatar Jul 05 '21 11:07 yahaha115