pdfkit报错:Exit with code 1 due to network error: ContentNotFoundError

        try:
        	if not os.path.exists(item["filename"]):
        		pdfkit.from_url(item["url"], item["filename"])
        	else:
        		print("文件已存在")
        except:
        	# 此处一个Exit with code 1 due to network error: ContentNotFoundError异常
        	# 此异常为是因为css文件引用了外部的资源,如:字体,图片,iframe加载等。
        	# 选择忽略此异常
        	pass


转载自:http://bbs.fishc.com/thread-101282-1-1.html qwc3000的答案

你可能感兴趣的:(python)