This is the HTML and code I have:
<a class="card__article-link" href="linktoarticle" title="articletitle">
<span class="card__egida">TEXT</span>
<span class="card__title ">TITLE</span>
<span class="card__subtitle">SUBTITLE</span>
</a>
import requests
from bs4 import BeautifulSoup
r = requests.get("link").text
soup = BeautifulSoup(r, "html.parser")
for span in soup.find_all("span", {"class": "card__egida"}):
print(span.get_text())
The code correctly prints TEXT but I want the code to also print TITLE and SUBTITLE. I have tried with nextSibling but with no success. How can I do that?