I need to align an HTML code , in some parts it comes totally "messy", example:
<li><a href="dsadas">dsadaads</a></li><li><a href="dsadas">dsadaads</a></li><li><a href="dsadas">dsadaads</a></li>
The html comes in just one line, and I want it to be organized like this:
<li><a href="dsadas">dsadaads</a></li>
<li><a href="dsadas">dsadaads</a></li>
<li><a href="dsadas">dsadaads</a></li>
An example would be site , it organizes everything. Now the question is: How can I align the entire site using PYTHON 2.7 . I noticed that there is a library on jsbeautifier site.
I downloaded it and tried to use it, but I did not understand the operation very well.
My code downloads the HTML from my site, which has a long list. Then the file comes as .HTML
JSBEAUTIFER
datafile = file('meusitehtml.html')
import jsbeautifier
res = jsbeautifier.beautify(datafile)
res = jsbeautifier.beautify_file('some_file.js')
I do not quite understand how I can use jsbeautifier .
- > I need an example of how I can use jsbeautifier ?