Python

Michael Poehner
Michael Poehner
4,465 Points

NoneType is not iterable

Hello, I am following along with the web scraping video and the following code throws a TypeError in Jupyter notebook..

from urllib.request import urlopen from bs4 import BeautifulSoup

html = urlopen('https://treehouse-projects.github.io/horse-land/index.html') soup = BeautifulSoup(html.read(), 'html.parser')

for button in soup.find(attrs={'class':'button button-primary'}): print(button)