Anyone know an elegant way to get the entire contents of a soup object as a single string?
At the moment I'm getting contents
, which is of course a list, and then iterating over it:
notices = soup.find("div", {"class" : "middlecontent"})
con = ""
for content in notices.contents:
con += str(content)
print con
Thanks!