Reputation: 3
I don't see why I'm getting an error on this. Could someone nice explain to me what's happening? I tried to follow some other examples, but apparently I have failed :P
import BeautifulSoup as bs
def readHTML():
soup = bs("stats.html")
print(soup.prettify())
Why am I getting a type error?
TypeError: 'module' object is not callable
Upvotes: 0
Views: 46
Reputation: 7882
You need to utilize the class "BeautifulSoup" that is within the module
from BeautifulSoup import BeautifulSoup as bs
def readHTML():
soup = bs("stats.html")
print(soup.prettify())
Upvotes: 1