Skip to content
New issue

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

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

Already on GitHub? # to your account

wc.search() 现在无法得到数据 #20

Closed
feiscar opened this issue Jul 12, 2022 · 2 comments
Closed

wc.search() 现在无法得到数据 #20

feiscar opened this issue Jul 12, 2022 · 2 comments

Comments

@feiscar
Copy link

feiscar commented Jul 12, 2022

使用最新的wencai,调用接口wc.search('今日涨停股')
得到Error ‘list indices must be integers or slices, not str’

发现访问https://search.10jqka.com.cn/unifiedwap/unified-wap/v2/result/get-robot-data
返回数据为{'status_code': -302, 'status_msg': '缺少必要参数', 'data': [], 'logid': '1adec78870b6c3ca66aacc8fb528a4a8'}
里面的data为空

大家有遇到这个问题吗?

@peakgao
Copy link

peakgao commented Jul 12, 2022

我今天也发现了,可能旧接口官方改变了。我的修改如下:
1、cons.py(21行)改成:
'search': 'http://www.iwencai.com/customized/chart/get-robot-data'
2、session.py(13行)改成:
'Content-Type': "application/json",
3、crawler.py(107行)改成:
r = self.session.post_result(url=WENCAI_CRAWLER_URL['search'],
json=payload, force_cookies=True)
你试试,行数但愿是对的,因为我本地做了些小修改,可能导致行号错误。

@feiscar
Copy link
Author

feiscar commented Jul 13, 2022

多谢楼上大神,换了url后就可以了。。。
另外,新的pull request里面的url也能够得到数据。。。

@feiscar feiscar closed this as completed Jul 13, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants