def main(login_pw): #환경세팅 Preference.setPhantomjsPath() Preference.setChromedriverPath() Preference.setWebDriverInit() try: #최근 몇개 주식을 가지고 올것이냐(250) Preference.setStockLoadCount("250") #250 #괴리율 랭킹 몇등까지 표출 Preference.setStockRankCount(30) #20 #이전목표주가는 몇개까지 표출 Preference.setPrePriceCount(7) #7 #몇일전 보고서 까지 찾을꺼냐 Preference.setStockDaysCount(14) #14 stock_dic_list = GetStockListfromHK.getCurrentStockConsenFromHK() result_html = HtmlMaker.makeSTOCKHtml(stock_dic_list) #print result_html print "--------------------------------" KST=datetime.now(timezone('Asia/Seoul')) title_name = KST.strftime('%Y년 %m월 %d일 %H시 '),' 상승여력 랭킹 ' driver = Preference.getWebDriver() WriteWordPress.write_post(WriteWordPress.write_init(driver,login_pw), Preference.getCategory("상승여력"), title_name, "", result_html) print "--------------------------------" except Exception as e: print '--- stack ---' traceback.print_stack() print '--- exec ---' traceback.print_exc() print '--- e ---' print e print "exception" finally: #Driver 닫기 Preference.setWebDriverClose()
def main(login_pw): #환경세팅 Preference.setPhantomjsPath() Preference.setChromedriverPath() Preference.setWebDriverInit() try: #이전목표주가는 몇개까지 표출 Preference.setPrePriceCount(7) stock_dic_list = GetStockListfromHK.getUpturnStockFromHK() result_html = HtmlMaker.makeUpturnStockHtml(stock_dic_list) print " " print "--------------------------------" print " " print result_html print "--------------------------------" KST = datetime.now(timezone('Asia/Seoul')) title_name = KST.strftime('%Y년 %m월 %d일 %H시 '), ' 목표가 상향기업 ' driver = Preference.getWebDriver() WriteWordPress.write_post(WriteWordPress.write_init(driver, login_pw), Preference.getCategory("목표상향"), title_name, "", result_html) print "--------------------------------" except Exception as e: print '--- stack ---' traceback.print_stack() print '--- exec ---' traceback.print_exc() print '--- e ---' print e print "exception" finally: #Driver 닫기 Preference.setWebDriverClose()
def main(login_pw): #환경세팅 Preference.setPhantomjsPath() Preference.setChromedriverPath() Preference.setWebDriverInit() try: #이전목표주가는 몇개까지 표출 Preference.setPrePriceCount(7) Preference.setStockRankCount(20) #GetStockInfoDetail.getCommpanyInfo('054950') #exit(0) stock_dic_list = GetStockListfromMaster.getStockListfromCreonPlus() for astock in stock_dic_list: print(astock['stock_code'], " : ", astock['stock_name']) Preference.setStockRankCount(len(stock_dic_list)) result_html = HtmlMaker.makeSTOCKHtml(stock_dic_list) print("############################################") print("############################################") print("############################################") print(result_html) print("--------------------------------") KST = datetime.now(timezone('Asia/Seoul')) title_name = KST.strftime('%Y년 %m월 %d일 %H시 '), ' 오늘의 특징 주 ' driver = Preference.getWebDriver() WriteWordPress.write_post(WriteWordPress.write_init(driver, login_pw), Preference.getCategory("오늘의특징주"), title_name, "", result_html) print("--------------------------------") ''' print "--------------------------------" KST=datetime.now(timezone('Asia/Seoul')) title_name = KST.strftime('%Y년 %m월 %d일 %H시 '),' 상승여력 랭킹 ' driver = Preference.getWebDriver() WriteWordPress.write_post(WriteWordPress.write_init(driver,login_pw), Preference.getCategory("상승여력"), title_name, "", result_html) print "--------------------------------" ''' except Exception as e: print('--- stack ---') traceback.print_stack() print('--- exec ---') traceback.print_exc() print('--- e ---') print(e) print("exception") finally: #Driver 닫기 Preference.setWebDriverClose()