I have a script that is running perfectly on my Mac, but giving me an error in Pythonista.
BeautifulSoup is throwing an AttributeError: 'NoneType' object has no attribute 'next_element'
on finding all data points in an HTML table: soup.find('table').find_all('td')
.
I can verify that soup
appears correct and has the td
that I'm looking for. I can print soup.find('table')
in the console and it is correct. I can break it down to table = soup.find('table'); table.find_all('td');
and it still doesn't work. I've tried changing to the old .findAll
instead of .find_all
and that doesn't work either.
In fact, even soup.find('table').find('td')
works correctly, but gives the error when changing .find('td')
to .find_all('td')
.
find_all seems to work in some contexts, e.g. `bs4.BeautifulSoup(requests.get('http://omz-software.com').content).find('p').find_all('a') seems to work fine.
I can verify the identical code (synced by Dropbox) works fine on Python 2.7.8 in OS X.
Has anyone run into this?