I have the following bs4 object listing:
>>> listing .... >>> type(listing) 相关标签:
Just get the string representation:
html_content = str(listing)
This is a non-prettified version.
If you want a prettified one, use prettify() method:
html_content = listing.prettify()