def getHomePage(self): url = "http://roll.finance.sina.com.cn/finance/zq1/ssgs/index_1.shtml"; saveFile=TimeUtil.prefix()+"home.txt" FileUtil.put(saveFile, ''); res=getPage(url) for (k,v) in res.items(): FileUtil.appendline(saveFile, k+'|'+v );
def getDetailPage(self): srcFile=TimeUtil.prefix()+".txt" content=FileUtil.readlines(srcFile) for str in content: url=str.split('|')[1] print url