1

I am new to programming and Python. I am trying to install BeutifulSoup on Python3 to learn web scraping (using Jupyter Notebooks as an IDE) for MOOC. When I run from bs4 import BeautifulSoup I receive the following error

AttributeError Traceback (most recent call last) in 3 import ssl 4 print("done2") ----> 5 from bs4 import BeautifulSoup 6 print("done3")

~\Desktop\py4e\code3\code3\bs4__init__.py in 28 import warnings 29 ---> 30 from .builder import builder_registry, ParserRejectedMarkup 31 from .dammit import UnicodeDammit 32 from .element import (

~\Desktop\py4e\code3\code3\bs4\builder__init__.py in ' 312 register_treebuilders_from(_htmlparser) 313 try: --> 314 from . import _html5lib 315 register_treebuilders_from(_html5lib) 316 except ImportError:

~\Desktop\py4e\code3\code3\bs4\builder_html5lib.py in 68 69 ---> 70 class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder): 71 72 def init(self, soup, namespaceHTMLElements):

AttributeError: module 'html5lib.treebuilders' has no attribute '_base'

I have tried the following solutions:

1) pip install html5lib==0.9999999 2) pip install --upgrade html5lib==1.0b8 3) pip install --upgrade bleach==1.4.2 3) Updating BeutifulSoup (pip install) 4) Reinstalling html5lib to latest version after downgrades didnt work

Your assistance is greatly appreciated!

RAB_95
  • 21
  • 2

0 Answers0