0hoo / snowball

11 stars 10 forks source link

snowball 잘 쓰고있는 수강생인데요, 종목갱신이 되지않습니다. #3

Open lako-UX opened 5 years ago

lako-UX commented 5 years ago

'python script.py --allsnowball' 라고 입력하면

'IndexError: list index out of range'

라고 나오네요ㅜ 잘 쓰고 있었는데 뭔가 설정이 바뀐거같습니다

lako-UX commented 5 years ago

(base) Lakos-iMac-2:snowball lako$ python script.py --allsnowball 1122 종목 수집 종목 095570 기본... 다음 http://finance-service.daum.net/item/main.daum?code=095570 종목명: AJ네트웍스 현재가: 4850.0 update: {'code': '095570', 'title': 'AJ네트웍스', 'current_price': 4850.0, 'price_diff': 0.0, 'rate_diff': 0.0, 'per': 15.16, 'pbr': 0.79, 'trade_volume': 23002.0, 'trade_value': 109.0, 'exchange': '코스피', 'agg_value': 2271.0} 종목 095570 FnGuide... FnGuide http://comp.fnguide.com/SVO2/ASP/SVD_main.asp?pGB=1&gicode=A095570 46,822,295/ 0 update: {'code': '095570', 'group': '서비스업', 'subgroup': 'FICS 호텔및레저', 'closing_month': 12, 'forward_per': 20.46, 'group_per': 25.23, 'dividend_rate': 1.77, 'relative_earning_rate': -41.57, 'month1': -1.22, 'month3': -8.49, 'month6': -25.95, 'month12': -41.57, 'foreigner_weight': 8.03, 'beta': 0.7116, 'has_preferred_stock': False, 'floating_rate': 0, 'YoY': 57.63, 'consensus_point': 4.0, 'consensus_price': 8000, 'consensus_count': 1, 'bps': 6168, 'use_fnguide': True} 종목 095570 FnGuide 재무재표 ... FnGuide 재무재표 http://comp.fnguide.com/SVO2/ASP/SVD_Finance.asp?pGB=1&gicode=A095570&cID=&MenuYn=Y&ReportGB=&NewMenuID=103 [2015, 2016, 2017, 2018] [2528.0, 3454.0, 3189.0, 16036.0] [8171.0, 9924.0, 12077.0, 17095.0] [13272.0, 16538.0, 19071.0, 21054.0] [(2015, 10556.0), (2016, 12539.0), (2017, 14310.0), (2018, 7823.0)] [(2015, 0), (2016, 0), (2017, 0), (2018, 0)] [(2015, 9813.0), (2016, 11920.0), (2017, 13538.0), (2018, 7671.0)] update: {'code': '095570', 'current_assets': [(2015, 2528.0), (2016, 3454.0), (2017, 3189.0), (2018, 16036.0)], 'current_liability': [(2015, 8171.0), (2016, 9924.0), (2017, 12077.0), (2018, 17095.0)], 'total_liability': [(2015, 13272.0), (2016, 16538.0), (2017, 19071.0), (2018, 21054.0)], 'sales': [(2015, 10556.0), (2016, 12539.0), (2017, 14310.0), (2018, 7823.0)], 'sales_cost': [(2015, 0), (2016, 0), (2017, 0), (2018, 0)], 'SGAs': [(2015, 9813.0), (2016, 11920.0), (2017, 13538.0), (2018, 7671.0)]} 종목 095570 FnGuide 재무비율 ... FnGuide 재무비율 http://comp.fnguide.com/SVO2/ASP/SVD_FinanceRatio.asp?pGB=1&gicode=A095570&cID=&MenuYn=Y&ReportGB=&NewMenuID=104 update: {'code': '095570', 'loan_rate': [(2014, 343.9), (2015, 263.8), (2016, 302.5), (2017, 349.4), (2018, 139.4)], 'net_current_loan': [(2014, 9742.0), (2015, 10501.0), (2016, 12931.0), (2017, 15625.0), (2018, 7217.0)], 'interest_cost': [(2014, 429.0), (2015, 403.0), (2016, 433.0), (2017, 492.0), (2018, 0.0)], 'interest_coverage': [(2014, 1.8), (2015, 1.8), (2016, 1.4), (2017, 1.6), (2018, 0)], 'ROICs': [(2014, 5.1), (2015, 4.3), (2016, 2.4), (2017, 2.6), (2018, -7.6)], 'NOPATs': [(2014, 593.0), (2015, 563.0), (2016, 369.0), (2017, 483.0), (2018, -1140.0)], 'ICs': [(2014, 11615.0), (2015, 13209.0), (2016, 15462.0), (2017, 18354.0), (2018, 14917.0)], 'total_asset_turnover': [(2014, 0.8), (2015, 0.7), (2016, 0.7), (2017, 0.7), (2018, 0.4)], 'net_working_capital_turnover': [(2014, 159.5), (2015, 97.1), (2016, 29.1), (2017, 16.2), (2018, 9.5)], 'net_working_capital': [(2014, 63.0), (2015, 109.0), (2016, 431.0), (2017, 886.0), (2018, 1103.0)]} 종목 095570 스노우볼... Traceback (most recent call last): File "script.py", line 24, in scrapper.parse_snowball_stocks(filter_bad=True) File "/Users/lako/snowball/scrapper.py", line 56, in parse_snowball_stocks parse_snowball(stock['code']) File "/Users/lako/snowball/scrapper.py", line 204, in parse_snowball tree = tree_from_url(url) File "/Users/lako/snowball/scrapper.py", line 65, in tree_from_url return html.fromstring(content) File "/Users/lako/anaconda3/lib/python3.6/site-packages/lxml/html/init.py", line 876, in fromstring doc = document_fromstring(html, parser=parser, base_url=base_url, **kw) File "/Users/lako/anaconda3/lib/python3.6/site-packages/lxml/html/init.py", line 765, in document_fromstring "Document is empty") lxml.etree.ParserError: Document is empty