HTML 문서를 구문 분석하려고하는데, 여러분이 저를 도울 수 있는지 궁금합니다.클래스 이름 대체 BeautifulSoup
<tr height="21" style="height:15.75pt">
<td class="style14" height="21" style="height: 15.75pt">
71
</td>
<td class="style14">
Breakeven
</td>
<td class="style10">
The Script
<span style="mso-spacerun:yes">
</span>
</td>
</tr>
td class = 'style10'을 class = 'style14'로 변경하고 싶습니다. 그러나 스타일 14로 변경하면 가져 오지 않습니다. 따라서 "The Script"는 인쇄되지 않습니다.
search =soup.find('td', class_='style10')
search['class'] = 'style14'
for each in search:
print each.text
이 할 수있는 방법이 있나요 :
여기 내 코드입니까?
는 당신이'search'를 통해 클래스 * 후 * 반복하는 수정할 수 없습니다? – Bakuriu
루프에서 각각을 인쇄하는 경우 어떻게됩니까? –