gala question
gala question

Reputation: 11

BeautifulSoup failed on html.parser

I am new to BeautifulSoup, but I am trying to use the simplest html.parser, however it fails, I have checked the version I am running is BeautifulSoup4 and I am on python 3.6. (Besides, I tried html5lib and lxml both installed but did not work for me) Is there anything I miss out here?

import urllib.request
import html
from BeautifulSoup.bs4 import BeautifulSoup

webpage = "https://www.tradingview.com/markets/currencies/rates-major/"

websource = urllib.request.urlopen(webpage)

soup = BeautifulSoup(websource.read(),'html.parser')

FeatureNotFound Traceback (most recent call last) in () 7 websource = urllib.request.urlopen(webpage) 8 ----> 9 soup = BeautifulSoup(websource.read(),'html.parser') 10 11 print(soup)

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

Upvotes: 1

Views: 568

Answers (1)

user13925035
user13925035

Reputation:

If you have installed BeautifulSoup properly then your import statement should read :

from bs4 import BeautifulSoup

Upvotes: 1

Related Questions