stockInfo.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:stockUtils 作者: caiyue 项目源码 文件源码
def getMostValueableStockList(self):
        '''????????'''
        page = 1
        cList = []
        while True:
            res = getHtmlFromUrl(mostValueableStockUrl % page)
            if res:page += 1
            companyListObj = getJsonObj(res)
            if companyListObj:
                list =  companyListObj['Results']
                if list and len(list):
                    for item in list:
                        stockInfo = item.split(',')
                        jzcsyl = str(float(stockInfo[5].split('(')[0]) * 100) + '%'
                        fhlrzzl = str(float(stockInfo[3].split('(')[0]) * 100) + '%'
                        orgCount = stockInfo[4].split('(')[0]
                        sz = str(int(float(stockInfo[6])/10000/10000))
                        cinfo = MostValueableCompanyInfo(stockInfo[1],stockInfo[2],jzcsyl,fhlrzzl,orgCount,sz)
                        cList.append(cinfo)
                    if len(list) < pageSize:break
                    #???????????????????????
                    if int(companyListObj['PageCount']) < page:break
                else:break
            else:break
        return cList
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号