Update start.py
转Pdf失败时自动跳过
This commit is contained in:
parent
f98ee35da6
commit
6b15ee6459
5
start.py
5
start.py
@ -230,7 +230,10 @@ def PDFDir(htmldir,pdfdir):
|
||||
"""
|
||||
[s.extract() for s in bs(["script", "iframe", "link"])]
|
||||
SaveFile(tmppath, str(bs))
|
||||
PDFOne(tmppath,pdfpath)
|
||||
try:
|
||||
PDFOne(tmppath,pdfpath)
|
||||
except:
|
||||
print("转pdf失败,可能是因为标题中有特殊字符",f)
|
||||
|
||||
#把一个Html文件转为pdf
|
||||
def PDFOne(htmlpath,pdfpath,skipExists=True,removehtml=True):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user