We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ab5ce5 commit fba7af3Copy full SHA for fba7af3
1 file changed
scripts/real_madrid/official_news.py
@@ -60,11 +60,9 @@ def getArticleData(url):
60
"div", class_="news-detail__main--text"
61
)
62
if descriptionContainers:
63
- for descriptionContainer in descriptionContainers:
64
- pTags = descriptionContainer.find_all("p")
65
- if not pTags:
66
- continue
67
- desc += "\n" + pTags[0].get_text(strip=True)
+ pTag = descriptionContainers[0].find("p")
+ if not pTag:
+ desc += "\n" + pTag.get_text(strip=True)
68
69
if desc:
70
desc = "\n" + f"{desc[:800]}..." if len(desc) > 800 else desc + "\n"
0 commit comments