This is a beautifulsoup
procedure that grabs content within all <p>
html tags. After grabbing content from some web pages, I get an error that says maximum recursion depth exceeded.
def printText(tags):
for tag in tags:
if tag.__class__ == NavigableString:
print tag,
else:
printText(tag)
print ""
#loop over urls, send soup to printText procedure
The bottom of trace:
File "web_content.py", line 16, in printText
printText(tag)
File "web_content.py", line 16, in printText
printText(tag)
File "web_content.py", line 16, in printText
printText(tag)
File "web_content.py", line 16, in printText
printText(tag)
File "web_content.py", line 16, in printText
printText(tag)
File "web_content.py", line 13, in printText
if tag.__class__ == NavigableString:
RuntimeError: maximum recursion depth exceeded in cmp