0
您好我想讀取一個index.html文件並希望(漂亮打印)輸出在其他文件中。請幫我使用pythonPrettyPrint HTML文件並將輸出寫入其他
您好我想讀取一個index.html文件並希望(漂亮打印)輸出在其他文件中。請幫我使用pythonPrettyPrint HTML文件並將輸出寫入其他
我會建議BeautifulSoup4,您可以通過pip install bs4
然後安裝,這是因爲這
print(BeautifulSoup(open("path/to/file/filename.html").read()).prettify())
取決於你如何使用它作爲簡單的,你可以什麼把它分成幾行。