Comments (3)
@Tishacy please look into this issue!
from scidownl.
Also returning the saved_filepath
instead of None
makes more sense while downloading the files
from scidownl.scihub import *
DOI = "10.1021/ol9910114"
out = 'paper'
sci = SciHub(DOI, out).download(choose_scihub_url_index=3)
from scidownl.
You can just use this hotfix>
from scidownl.scihub import *
class SciHub(SciHub):
def __init__(self, doi, out='.', title=None):
self.doi = doi
self.out = out
self.title = title
self.sess = requests.Session()
self.check_out_path()
self.read_available_links()
def find_pdf_in_html(self, html):
pdf = {}
soup = BeautifulSoup(html, 'html.parser')
pdf_url = soup.find('embed', {'id': 'pdf'}).attrs['src'].split('#')[0]
pdf['pdf_url'] = pdf_url.replace('https', 'http') if 'http' in pdf_url else 'http:' + pdf_url
#title = ' '.join(self._trim(soup.title.text.split('|')[1]).split('/')).split('.')[0]
#title = title if title else pdf['pdf_url'].split('/')[-1].split('.pdf')[0]
self.title = self.title if self.title else pdf['pdf_url'].split('/')[-1].split('.pdf')[0]
pdf['title'] = self.check_title(self.title)
print(STD_INFO + colored('PDF url', attrs=['bold']) + " -> \n\t%s" %(pdf['pdf_url']))
print(STD_INFO + colored('Article title', attrs=['bold']) + " -> \n\t%s" %(pdf['title']))
return pdf
Also fixed in this PR #16.
from scidownl.
Related Issues (20)
- Automatic captcha? HOT 3
- 'NoneType' object has no attribute 'attrs'
- 'NoneType' object has no attribute 'attrs'
- multiple download issue HOT 1
- is it possible to use proxies? HOT 1
- Getting AttributeError when downloading pdf HOT 10
- Error occurs: CERTIFICATE_VERIFY_FAILED. How do deal with that?
- How to get the download link?
- Failed to access the article
- -bash: syntax error near unexpected token `('
- crawling failed HOT 1
- Download Through Title or other Input Source? HOT 1
- Can't download papers with DOI with "(" or ")"
- How to add or remove Sci-Hub domains in SciDownl?
- Was everything ok until this error message Index out of range HOT 5
- new url HOT 2
- Auto captcha no longer working.
- Is there any character limit for file name downloaded by this package? HOT 1
- Few articles not found when inside FOR loop and found when downloaded indivudally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scidownl.