Skip to content Skip to sidebar Skip to footer

What Does "module Object Is Not Callable" Mean?

I'm using the .get_data() method with mechanize, which appears to print out the html that I want. I also check the type of what it prints out, and the type is 'str'. But when I try

Solution 1:

When you import BeatufilulSoup like this:

import BeautifulSoup

You are importing the module which contains classes, functions etc. In order to instantiate a BeautifulSoup class instance form the BeautifulSoup module you need to either import it or use the full name including the module prefix like yonili suggests in the comment above:

from BeautifulSoup importBeautifulSoupsoup= BeautifulSoup(html)

or

importBeautifulSoupsoup= BeautifulSoup.BeautifulSoup(html)

Post a Comment for "What Does "module Object Is Not Callable" Mean?"