This commit is contained in:
Manish 2020-05-04 08:59:24 +10:00 committed by GitHub
parent 2858555aae
commit d6cdfe3c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,18 +14,18 @@ import PyPDF2
import urllib3
import wget
def foo(m):
def download(part_page_url):
http =urllib3.PoolManager()
n="ht"+m
page_url="https"+part_url
res =http.request('GET',n)
res =http.request('GET',page_url)
title=''.join(res.data.decode('utf-8').split('h1')[1].split('>')[1].split('<')[0].split('/')[0])+".pdf"
uld="http://link.springer.com/content/"+res.data.decode('utf-8').split('Download book PDF')[0].split('content/')[1].split('title')[0].split('.pdf')[0]+".pdf"
dl_url="https://link.springer.com/content/"+res.data.decode('utf-8').split('Download book PDF')[0].split('content/')[1].split('title')[0].split('.pdf')[0]+".pdf"
wget.download(uld,title)
wget.download(dl_url,title)
file =open('Spring.pdf','rb')