Пример #1
0
def main(login_pw, mail_pw):

    #환경세팅
    Preference.setPhantomjsPath()
    Preference.setChromedriverPath()
    Preference.setWebDriverInit()

    try:
        #최근 몇개 주식을 가지고 올것이냐(250)
        Preference.setStockLoadCount("250")
        #250
        #괴리율 랭킹 몇등까지 표출
        Preference.setStockRankCount(50)
        #20
        #이전목표주가는 몇개까지 표출
        Preference.setPrePriceCount(7)
        #7
        #몇일전 보고서 까지 찾을꺼냐
        Preference.setStockDaysCount(14)
        #14

        stock_dic_list = GetStockListfromHK.getCurrentStockConsenFromHK()

        count, result_html = HtmlMaker.makeVolumeUpHtml(stock_dic_list)

        print "  "
        print "--------------------------------"
        print "  "

        #print result_html

        print "--------------------------------"

        KST = datetime.now(timezone('Asia/Seoul'))
        title_name = KST.strftime('%Y년 %m월 %d일 %H시 '), ' 저평가 거래 폭증종목 Catcher'

        driver = Preference.getWebDriver()

        if (count > 1):
            if (Preference.isLinux()):
                SendEmail.sendMailtoGmail(title_name, result_html, mail_pw)

            time.sleep(10)
            #WriteWordPress.write_post(WriteWordPress.write_init(driver,login_pw), Preference.getCategory("거래폭발"), title_name, "", result_html)
        else:
            print "Nothing Catched"

        print "--------------------------------"

    except Exception as e:
        print e
        traceback.print_stack()
        traceback.print_exc()
        print "exception"

    finally:
        #Driver 닫기
        Preference.setWebDriverClose()
Пример #2
0
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()
Пример #3
0
def main(login_pw, mail_pw):

    #환경세팅
    Preference.setPhantomjsPath()
    Preference.setChromedriverPath()
    Preference.setWebDriverInit()

    try:

        #몇일간 리포트 확인, 최근 1주리포트
        Preference.setStockDaysCount(7)
        #이전목표주가는 몇개까지 표출
        Preference.setPrePriceCount(7)

        ##목표주가 상향 리포트 확인
        stock_dic_list = GetStockListfromHK.getUpturnStockFromHK()
        ### 크레온 Plus에서 수급정보 가져오기
        stock_dic_list = GetDetailInfoFromPlus.getPlusStockInfo(stock_dic_list)
        ###

        result_html = HtmlMaker.makeUpturnAllStockHtml(stock_dic_list)

        print("--------------------------------")
        print(result_html)
        print("--------------------------------")

        KST = datetime.now(timezone('Asia/Seoul'))
        title_name = KST.strftime('%Y년 %m월 %d일 %H시 '), ' 목표가 상향기업 '

        print("WordPress Write Start")
        driver = Preference.getWebDriver()
        #WriteWordPress.write_post(WriteWordPress.write_init(driver,login_pw), Preference.getCategory("목표상향"), title_name, "", result_html)
        print("WordPress Write Complete")
        print("--------------------------------")
        print("Send Email Start")
        SendEmail.sendMailtoGmail(title_name, result_html, mail_pw)

    except Exception as e:
        traceback.print_stack()
        traceback.print_exc()
        print(e)
        print("exception")

    finally:
        #Driver 닫기
        Preference.setWebDriverClose()
Пример #4
0
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()
Пример #5
0
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()
Пример #6
0
def main(login_pw, mail_pw):

    #환경세팅
    Preference.setPhantomjsPath()
    Preference.setChromedriverPath()
    Preference.setWebDriverInit()

    try:

        #몇일 전 목표가 상향보고서까지 가지고 올건지
        Preference.setStockDaysCount(14)

        #이전목표주가는 몇개까지 표출
        Preference.setPrePriceCount(7)

        ### RSI과매도 종목을 몇개까지?
        Preference.setStockRankCount(20)

        ### 목표가 상향 종목 가져오기
        stock_dic_list = GetStockListfromHK.getUpturnStockFromHK()
        ### 크레온 Plus에서 수급정보 가져오기
        stock_dic_list = GetDetailInfoFromPlus.getPlusStockInfo(stock_dic_list)
        ###

        result_html = HtmlMaker.makeUpturnStockHtml(stock_dic_list)

        try:
            ### 과매도 종목 가져오기 ###
            print("RSI 과매도 종목 가져오기")
            stock_dic_list2 = GetStockListfromMaster.getStockListfromCreonPlus(
            )
            stock_dic_list2 = GetDetailInfoFromPlus.getPlusStockInfo(
                stock_dic_list2)
            result_html += HtmlMaker.makeRSIdownSTOCKHtml(stock_dic_list2)
        except Exception as E:
            print("RSI과매도 가져오기 실패")
            print(E)
            traceback.print_exc()

        result_html += HtmlMaker.getPostScript()

        print(result_html)

        KST = datetime.now(timezone('Asia/Seoul'))
        title_name = KST.strftime('%Y년 %m월 %d일 %H시 '), ' CHOICESTOCK '

        #if(ResultVO.getIsCatched()):
        print("WordPress Write Start")

        driver = Preference.getWebDriver()
        #WriteWordPress.write_post(WriteWordPress.write_init(driver,login_pw), Preference.getCategory("목표상향"), title_name, "", result_html)

        print("WordPress Write Complete")
        print("Send Email Start")
        SendEmail.sendMailtoGmail(title_name, result_html, mail_pw)
        #else:
        #print("CHOICESTOCK Didn't Catch Any Stock")

    except Exception as e:
        print('--- stack ---')
        traceback.print_stack()
        print('--- exec ---')
        traceback.print_exc()
        print(e)
        print("exception")

    finally:
        #Driver 닫기
        Preference.setWebDriverClose()