def get_year(self):
try:
yre = '(dei:DocumentFiscalYearFocus$)'
year = self.ins_sp.find(name=re.compile(yre, re.IGNORECASE | re.MULTILINE)).get_text()
except AttributeError:
try:
yre = '(dei:DocumentPeriodEndDate$)'
year = self.ins_sp.find(name=re.compile(yre, re.IGNORECASE | re.MULTILINE)).get_text()
year = year[:4]
except AttributeError:
return False
try:
year = int(year)
sure_years = [2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2011,
2012, 2013, 2014, 2016]
if year in sure_years:
self.xbrl_year = str(year)
if year == 2010:
self.xbrl_year = '2009'
if year == 2015:
self.xbrl_year = '2014'
return True
except:
return False
评论列表
文章目录