基于Python的Arxiv文章批量下载

  1. 将你需要下载的arxiv文章链接或者arxiv number,分行写入arxiv_paper_list.txt
    形如
    https://arxiv.org/pdf/2006.09238
    https://arxiv.org/pdf/2009.14178
    https://arxiv.org/pdf/2101.01373
  2. 运行arxivPaperDownload.py,代码基于项目(https://github.com/Tachyu/Arxiv-download/tree/c9eb7cdcff80a86c7df4db062572a7439cf5383c)
import time 
from selenium import webdriver
import requests
import threading
import os 

def Handler(start, end, url, filename): 
    # specify the starting and ending of the file 
    headers = {
   'Range': 'bytes=%d-%d' % (start, end)} 
    # request the specified part and get into variable     
    r = requests.get(url, headers=headers, stream=True) 
    # open the file and write the content of the html page into file. 
    with open(filename, "r+b") as fp: 
        fp.seek(start) 
        var = fp.tell() 
        fp.write(r.content)

def download_file(url_of_file,name,number_of_threads): 
    r = requests.head(url_of_file) 
    if name: 
        file_name = name 
    else: 
        file_name = url_of_file
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值