Thursday, 8 August 2013

In Python 3 with BeautifulSoup, the print(soup.get_text()) generates an error ('NoneType' object is not callable) in the following code:

In Python 3 with BeautifulSoup, the print(soup.get_text()) generates an
error ('NoneType' object is not callable) in the following code:

This code generates a NoneType object error. The "print(soup.get_text())"
is indicated as the problem. How do I fix this?
import urllib
from BeautifulSoup import BeautifulSoup
base_url = "http://www.galactanet.com/oneoff/theegg_mod.html"
url = (base_url)
content = urllib.urlopen(url)
soup = BeautifulSoup(content)
print(soup.get_text())

No comments:

Post a Comment