# !/usr/bin/python3
# -*- coding: utf-8 -*-
import re
from lxml import etree
import requests
import time
from tqdm import tqdm
import os
from urllib.request import urlopen
def download_from_url(url, dst):
"""
@param: url to download file
@param: dst place to put the file
:return: bool
"""
# 获取文件长度
try:
file_size = int(urlopen(url).info().get('Content-Length', -1))
except Exception as e:
print(e)
print("错误,访问url: %s 异常" % url
发布评论