美文网首页
批量pdf下载

批量pdf下载

作者: 月夜星空下 | 来源:发表于2021-07-01 10:15 被阅读0次
import requests

file_read = open("创业板:年报_半年报_问询函.txt", encoding='utf-8')
i = 0
while True:
    try:
        text = file_read.readline()
        text = text.replace('\n','')
        if len(text) > 2:
            url = 'http://reportdocs.static.szse.cn/UpFiles/fxklwxhj/{}?random=0.42680171432249325'.format(text)
            res = requests.get(url)
            res.encoding = res.apparent_encoding
            file_path = r'\\192.168.1.23\tools\创业板:年报_半年报_问询函' + '\\'
            dir = file_path + text
            with open(dir, 'wb') as f:
                f.write(res.content)
            i += 1
            print('successful', i)

    except Exception as e:
        print(e)
        pass

相关文章

网友评论

      本文标题:批量pdf下载

      本文链接:https://www.haomeiwen.com/subject/wwkjultx.html