import requests


# 请求下载excel
def downloading(text_path):
    # 访问要下载的链接文件
    with open(text_path) as f:
        for line in f.readlines():
            try:
                # 获取内容,生成xls
                r = requests.get(line)
                excel_name = text_path[:-5] + ".xls"
                with open(excel_name, "wb") as code:
                    code.write(r.content)
            except:
                print("地址错误无法下载")

相关文章:

  • 2021-09-09
  • 2022-01-13
  • 2021-11-04
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2021-12-15
猜你喜欢
  • 2022-01-18
  • 2022-12-23
  • 2021-12-16
  • 2021-07-14
  • 2021-08-14
  • 2021-11-04
相关资源
相似解决方案