from io import BytesIO import requests import pdfplumber req = requests.get("https://www1.hkexnews.hk/listedco/listconews/sehk/2020/0124/2020012400942_c.pdf") with pdfplumber.load(BytesIO(req.content)) as pdf: print(pdf.pages[0].extract_text())
json.dump(infors_li,open("/Users/dengxinkaiacca163.com/Desktop/机器学习数据/1.json","w")) s_str = json.dumps(a,ensure_ascii=False)
#下载pdfimport json infors_li = [{"k1": "v1"}, {"k2": "v2"}, {"k3": "v3"}, {"k4": "v4"}] with open("demo.json", "w") as f: json.dump(infors_li, f, indent=4)
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/275332.html