Created
September 25, 2017 14:10
-
-
Save dongyi/eb5b4a10429844d291726a605b97b0e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import sys | |
def convert_html(filename): | |
f = open(filename) | |
soup = BeautifulSoup(f) | |
f.close() | |
with open(filename.replace('.html', '.xml'), 'w') as ff: | |
ff.write(soup.prettify()) | |
if __name__ == '__main__': | |
import sys | |
convert_html(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment