chevron_left
Miscellaneous Cookbook
0
0
0
new
Pretty-printing in Beautiful Soup
Programming
chevron_rightPython
chevron_rightBeautiful Soup
chevron_rightCookbooks
chevron_rightMiscellaneous Cookbook
schedule Mar 10, 2022
Last updated Python●Beautiful Soup
Tags tocTable of Contents
expand_more To pretty-print in Beautiful Soup, use the prettify()
method.
Example
Consider the following HTML document:
my_html = """soup = BeautifulSoup(my_html)
To pretty-print our HTML tree:
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...