I'm trying to get some information from an RSS feed, more specifically the data contained in the "filing-type" section. However the section contains a hyphen and so when i run the code:
import feedparser
BEGIN_URL = "https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK="
FINISH_URL = "&type=&dateb=&owner=include&start=0&count=40&output=atom"
def check_sec_rss(ticker):
TARGET_URL = BEGIN_URL+ticker+FINISH_URL
feed = feedparser.parse(TARGET_URL)
for post in feed.entries:
print(post.filing-type)
check_sec_rss("AAPL")
I get an error:
Traceback (most recent call last):
File "D:/icsusV0.1/test3.py", line 10, in <module>
check_sec_rss("APDN")
File "D:/icsusV0.1/test3.py", line 8, in check_sec_rss
print(post.filing-type)
File "C:\Users\domin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\feedparser.py", line 400, in __getattr__
raise AttributeError("object has no attribute '%s'" % key)
AttributeError: object has no attribute 'filing'
Can someone point me in the right direction?