Привет ребята У меня есть вопрос о разборе HTML с BeautifulSoup Мой вопрос заключается в том, чтобы разобрать этот HTML:Python BeautifulSoup HTML разбора
<div class="time_table show_today" id="monday_schedule">
<h3>January 20, 2014</h3>
<table>
<tbody>
<tr>
<th>Time</th>
<th>Program</th>
</tr>
<tr>
<td class="time_part"> 0:00 </td>
<td class="show_content">
<h4>
First Up
</h4>
<p>
Bloomberg Television's award winning morning show takes a look at market openings in Asia and analyzes all the breaking news stories essential for your business day ahead. </p>
</td>
</tr>
<tr>
<td class="time_part"> 2:00 </td>
<td class="show_content">
<h4>
On the Move with Rishaad Salamat
</h4>
<p>
Rishaad Salamat brings you comprehensive coverage of market openings from Asia and live reporting on the stories most impacting business around the globe. </p>
</td>
</tr>
<tr>
<td class="time_part"> 4:00 </td>
<td class="show_content">
<h4>
Asia Edge
</h4>
<p>
Get to the bottom of the days major issues influencing business decisions with Rishaad Salamat. Asia Edge gives viewers a deeper perspective through extended interviews with the region's newsmakers as well as fast-paced panel discussions featuring Bloomberg's market reporters, business experts and influential guests. Stay ahead of the business day with Asia Edge. </p>
</td>
</tr>
Мой код выглядит как:
url = 'http://www.bloomberg.com/tv/schedule/europe/'
response = urllib2.urlopen(url)
soup = BeautifulSoup(response)
for line in soup.findAll('div',{'td','h4','p'}):
print line
Что я делая неправильный код, некоторые советы были бы замечательными. Проблема заключается в том, что <h3>January 20, 2014</h3
собирается около недели, и он принимает только один, но цикл не может ничего сделать, чтобы печатать его в каждой строке со всеми другими тегами.
Я не могу понять ваше последнее предложение вообще. Для чего вы хотите, чтобы результат был для данного HTML? –