Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


HTML parser

I am trying to run a simple BeautifulSoup script I get the following error from the following code: (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')


Error: FeatureNotFound Traceback (most recent call last) <ipython-input-13-c6a03e259650> in <module>() 3 4 html = urlopen('https://treehouse-projects.github.io/horse-land/index.html') ----> 5 soup = BeautifulSoup(html.read(), 'html-parser') 6 7 print(soup)

/home/migs/anaconda3/lib/python3.6/site-packages/bs4/init.py in init(self, markup, features, builder, parse_only, from_encoding, exclude_encodings, **kwargs) 163 "Couldn't find a tree builder with the features you " 164 "requested: %s. Do you need to install a parser library?" --> 165 % ",".join(features)) 166 builder = builder_class() 167 if not (original_features == builder.NAME or

FeatureNotFound: Couldn't find a tree builder with the features you requested: html-parser. Do you need to install a parser library?

1 Answer

I think you are looking for "html.parser" with a period instead of the hyphen.

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