5

I have installed the html5lib package. I'm sure because when i try to install it, i get a message that it is already installed.

pip install html5lib
Requirement already satisfied: html5lib in ./anaconda/lib/python3.5/site-packages

Also i am able to successfully import that package.

import html5lib

Yet when I try to use the parser as a part of the BeautifulSoup constructor

soup = BeautifulSoup(response.data, 'html5lib')

I'm unsuccessful

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

Is it possible to force bs4 to lookup the installed parsers and successfully find html5lib?

Parikshit Bhinde
  • 475
  • 8
  • 15
  • 1
    I thing you want `'html.parser'` instead of `'html5lib'`. If not and you are using a smart ide like pycharm, restart it. – MegaIng Sep 20 '17 at 16:45
  • 1
    html5lib is what i am looking for. its different from html.parser. see the list https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser – Parikshit Bhinde Sep 20 '17 at 16:47
  • Right python versions? – MegaIng Sep 20 '17 at 16:51
  • 1
    @MegaIng restarting the IDE (Spyder) worked. I've previously worked successfully after installing packages and without restarting the IDE so never thought that's something I'm missing out on. Thanks a lot! – Parikshit Bhinde Sep 20 '17 at 16:53

1 Answers1

4

Took Megalng's suggestion and restarted the IDE. That did the trick!

Parikshit Bhinde
  • 475
  • 8
  • 15