Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetCompleteHousingInfo()出错 #5

Open
wutao667 opened this issue Nov 12, 2018 · 2 comments
Open

GetCompleteHousingInfo()出错 #5

wutao667 opened this issue Nov 12, 2018 · 2 comments

Comments

@wutao667
Copy link

wutao667 commented Nov 12, 2018

直接执行代码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测试现象都是这样,换了网络也是不行

@wutao667
Copy link
Author

尝试以后,发现是用md5库计算的authorization返回结果有问题,替换成原js代码计算后,能返回正常结果

@xjkj123
Copy link
Owner

xjkj123 commented Nov 18, 2018

已经改进,现在可以不用调用js了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants