テーブルを解析しようとしていますが、項目番号 5 以外は問題ありません。アイテムにはもっと精巧なパラメーターがあるようです。
なぜこれが起こっているのか少し混乱しています
私が持っているコードは次のとおりです。
for row in tables.findAll('tr'):
col = row.findAll('td')
record =[]
for i in range(0,9):
cell = col[i].string.strip()
「スープ」で:
<td align="left" class="table-top">Item1</td>
<td align="left" class="table-top">Item2</td>
<td align="left" class="table-top">Item3</td>
<td align="center" class="table-top">Item4</td>
<td align="right" class="table-top">Item5 <img align="top" alt="" border="0" height="12" src="gfx/chart_hover_icon.gif" width="15"/></td>
最初の 4 つは解析されますが、5 はエラーになります。
cell = col[i].string.strip()
AttributeError: 'NoneType' object has no attribute 'strip'