Skip to content

Commit 4bad91b

Browse files
authored
fix: rss reader entry content attr not found bug (#435)
1 parent 3b529ef commit 4bad91b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

examples/data_connectors/WebPageDemo.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@
182182
"from gpt_index import GPTListIndex, RssReader\n",
183183
"\n",
184184
"documents = RssReader().load_data([\n",
185-
" \"https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml\",\n",
186-
" \"https://roelofjanelsinga.com/atom.xml\"\n",
185+
" \"https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml\"\n",
187186
" ])\n",
188187
"\n",
189188
"index = GPTListIndex(documents)\n",

gpt_index/readers/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def load_data(self, urls: List[str]) -> List[Document]:
248248
for url in urls:
249249
parsed = feedparser.parse(url)
250250
for entry in parsed.entries:
251-
if entry.content:
251+
if "content" in entry:
252252
data = entry.content[0].value
253253
else:
254254
data = entry.description or entry.summary

0 commit comments

Comments
 (0)