我有一個表結構,看起來像這樣:刮表BeautifulSoup
<tr><td>
<td>
<td bgcolor="#E6E6E6" valign="top" align="left">testtestestes</td>
</tr>
<tr nowrap="nowrap" valign="top" align="left">
<td nowrap="nowrap">8-K</td>
<td class="small">Current report, items 1.01, 3.02, and 9.01
<br>Accession Number: 0001283140-16-000129 Act: 34 Size: 520 KB
</td>
<td nowrap="nowrap">2016-09-19<br>17:30:01</td>
<td nowrap="nowrap">2016-09-19</td><td align="left" nowrap="nowrap"><a href="/cgi-bin/browse-edgar?action=getcompany&filenum=001-03473&owner=include&count=100">001-03473</a>
<br/>161891888</td></tr>
也就是說一行數據。這是我使用beautifulSoup的腳本。我可以得到<tr>
和<td>
就好了。但他們在一個單獨的列表中。
for tr in (soup.find_all('tr')):
tds = tr.find_all('td')
print tds
我的問題是如何從兩個獨立的<tr>
獲取數據,使它看起來像他們一行數據。我試圖讓<td>
什麼是你想獲得? –
所以你想每兩個trs配對? –
是的正確@PadraicCunningham – essramos