看起來一切都很順利: from bs4 import BeautifulSoupTitle = []content = """<div class="card-body text-center"><h4 class="card-title ">Title</h4><h7>Risen_star</h7><br> <h7>2022</h7><p style="height:57px" class="card-text ">hi</p><a href="/details" class="btn btn-md waves-effect">Read More</a></div>"""soup = BeautifulSoup(content,'html.parser')for a in soup.findAll('div',attrs={'class':'card-body text-center'}): title = a.find('h4',attrs={'class':'card-title'}) Title.append(title.text)print(Title) 這將導致: $ python3 test.py ['\nTitl