You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
直接执行代码lianjia.py,前面两步正常,执行到第三步GetCompleteHousingInfo()时会直接报错,错误代码如下:
Traceback (most recent call last):
File "lianjia.py", line 351, in
GetCompleteHousingInfo(city)#获取详细在售房屋
File "lianjia.py", line 332, in GetCompleteHousingInfo
ret = Lianjia(city).GetHousingInfo(x[0], x[1])
File "lianjia.py", line 214, in GetHousingInfo
for x in house_json['data']['ershoufang_info']['list']:
TypeError: 'NoneType' object is not subscriptable
此时如果切换使用pip包的方式调用执行第三步
import Lianjia.lianjia as lj
city='上海'
lj.GetCompleteHousingInfo(city)
则可以接着执行,不会出现上述错误
直接执行代码lianjia.py,前面两步正常,执行到第三步GetCompleteHousingInfo()时会直接报错,错误代码如下:
Traceback (most recent call last):
File "lianjia.py", line 351, in
GetCompleteHousingInfo(city)#获取详细在售房屋
File "lianjia.py", line 332, in GetCompleteHousingInfo
ret = Lianjia(city).GetHousingInfo(x[0], x[1])
File "lianjia.py", line 214, in GetHousingInfo
for x in house_json['data']['ershoufang_info']['list']:
TypeError: 'NoneType' object is not subscriptable
此时如果切换使用pip包的方式调用执行第三步
import Lianjia.lianjia as lj
city='上海'
lj.GetCompleteHousingInfo(city)
则可以接着执行,不会出现上述错误
将出错代码前一行的ret.text内容print出来为:
jQuery111106822012072868358_1534402288206({"request_id":"1914311585","uniq_id":"D41F-612E-203B-50C1-CA3355E268DD","errno":10001,"error":"invalid request","data":null})
似乎是Get请求失败了?
linux和windows测试现象都是这样,换了网络也是不行
The text was updated successfully, but these errors were encountered: