I'm trying to scrape the text from the "Industry" row of this table:
<tr>
<th style="padding-right: 0.5em;" scope="row">Industry</th>
<td class="category" style="line-height: 1.35em;">
<a title="Professional Services" href="/wiki/Professional_services">Professional services</a>
<br></br>
<a title="Technology Services" href="/wiki/Technology_services">Technology services</a>
</td>
</tr>
My python code is as follows (r being the table variable):
industry = r.find('th', text = 'Industry').findNext('td').find_all('a')[0].get_text()
print industry
The first one "Professional services" gets printed but then I get the error:
IndexError: list index out of range
From what I can reproduce, it could be because of the differences between parsers:
Note that I wasn't able to reproduce the exact same error as you've got.