有没有一种方法可以自动从EDGAR内的Interactive Data网页下载excel文件,以获得报价器列表,而无需手动搜索EDGAR上的每个报价器?或者,有没有一种方法可以到达一系列公司的XBRL,而不必再次物理地转到EDGAR中的每个页面?我在这方面遇到了问题,因为我不知道如何生成一个独特的URL,因为最后六个数字必须与该年的备案顺序和账号有关。
发布于 2015-05-27 23:20:26
Edgar没有API。我写了一个包,作为Edgar的接口,允许按报价器进行搜索。解析搜索结果页面的部分如下所示。整个文件在https://github.com/andrewkittredge/financial_fundamentals/blob/master/financial_fundamentals/edgar.py上。
SEARCH_URL = ('http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&'
'CIK={symbol}&type={filing_type}&dateb=&owner=exclude&count=100')
def _get_document_page_urls(symbol, filing_type):
'''Get the edgar filing document pages for the CIK.
'''
search_url = SEARCH_URL.format(symbol=symbol, filing_type=filing_type)
search_results_page = get_edgar_soup(url=search_url)
xbrl_rows = [row for row in
search_results_page.findAll('tr') if
row.find(text=re.compile('Interactive Data'))]
for xbrl_row in xbrl_rows:
documents_page = xbrl_row.find('a', {'id' : 'documentsbutton'})['href']
documents_url = 'http://sec.gov' + documents_page
yield documents_urlhttps://stackoverflow.com/questions/29759143
复制相似问题