先去https://pypi.python.org/pypi/pytidylib
跑官方提供的测试用例报错
ition 0: unexpected end of data Traceback (most recent call last): File "_ctypes/callbacks.c", line 314, in 'calling callback function' File "D:\Python27\lib\site-packages\tidylib\sink.py", line 79, in put_byte write_func(byte.decode('utf-8')) File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xb7 in position 0: invalid start byte
解决办法:
去http://www.paehl.com/open_source/?HTML_Tidy_for_Windows 下载LIBTIDY DLL
将dll解压到python安装目录下的Scripts文件夹即可