1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

めざせpythonライブラリマスター (38)beautiful_print

Posted at

#【ライブラリ説明】
 汚いHTMLをきれいにする

#【プログラム】

beautiful_print.py
# -*- coding: utf-8 -*-

from beautiful_print import beautiful_print

ugly_html = """
 <html> <body> <div>it sure is hot inside this div! <em>right?</em>
 </div> <p>Yep!</p> <img src=fire.gif></img> </body> </html>
 """
 
print beautiful_print(ugly_html)
'''
<html>
	<body>
		<div>
			it sure is hot inside this div! <em>right?</em>
		</div>
		<p>
			Yep!
		</p>
		<img src="fire.gif"/>
	</body>
</html>
'''

#【参考サイト】
 pypi
 github

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?