> #
原地址是图片格式: http://218.77.183.36:9088/ICPSP/getPdfToImage.action?id=141000030443718674
现地址PDF格式:http://218.77.183.36:9088/ICPSP/pdf.action?id=141000030443718674
原代码:
img = urlopen("https://e-register.amr.hainan.gov.cn/ICPSP/getPdfToImage.action?id={}".format(uid)).read()
img = Image.open(io.BytesIO(img))
img = img.convert("RGB")
qr = img.crop((910, 260, 1000, 345))
qr = qr.resize((x * 5 for x in qr.size))
qr = qr.save("test_bak.png", quality=95)
保存图片为test_bak.png
请问:PDF格式是怎么写代码?
>
#
PDF格式比较复杂,python有处理pdf的库,你可以找一下,我用过几个,但是效果都不太理想
用selenium直接截图