安装 pychm
yum install -y chmlib-devel
pip install pychm
pip install BeautifulSoup4
读取 chm 文件
来源:https://stackoverflow.com/questions/8645650/processing-chm-files
import chm.chm as chm
from bs4 import BeautifulSoup
chmfile = chm.CHMFile()
chmfile.LoadCHM(file_name)
iui = chmfile.ResolveObject(chmfile.home)
home = self.chmfile.RetrieveObject(iui[1])[1] # get home page (as html)
tree = BeautifulSoup(home)