如何自动下载pdf
网址:https://rd.gfqh.cn/RDInformation/article/3716。想要实现获取每个pdf的链接,并进行下载,请教大佬们如何实现? import requests
import re
import io
p = re.compile(r'"download-box" data-url="(.+?)" data-name="(.+?.pdf)', re.S)
r = requests.get("https://rd.gfqh.cn/RDInformation/article/3716")
pdf_list = p.findall(r.text)
for i in range(len(pdf_list)):
pdf_text = requests.get(pdf_list)
bytes_io = io.BytesIO(pdf_text.content)
with open(pdf_list, "wb") as f:
f.write(bytes_io.getvalue())
页:
[1]