I'm web scraping using Beautiful Soup. So, I've HTML code which has 8 tables. I'm trying to extract the contents from these tables.
for row in soup('table')[4].tbody('tr'):
tds = row('td')
print tds[0].string, tds[1].string
it gives the error:
for row in soup('table')[4].tbody('tr'):
TypeError: 'NoneType' object is not callable
I understand that probably soup('table')[4]
is becoming a None Type. But I don't understand why similar code worked here but not in my case?