Untested
This commit is contained in:
parent
2858555aae
commit
d6cdfe3c72
@ -14,18 +14,18 @@ import PyPDF2
|
|||||||
import urllib3
|
import urllib3
|
||||||
import wget
|
import wget
|
||||||
|
|
||||||
def foo(m):
|
def download(part_page_url):
|
||||||
http =urllib3.PoolManager()
|
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"
|
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')
|
file =open('Spring.pdf','rb')
|
||||||
|
Loading…
Reference in New Issue
Block a user