diff options
author | Ken Kellner <ken@kenkellner.com> | 2018-04-25 16:49:06 -0400 |
---|---|---|
committer | Ken Kellner <ken@kenkellner.com> | 2018-04-25 16:49:06 -0400 |
commit | 6b4fc7ea1aaa3c9e91d8bcc3ceda0d779eac3215 (patch) | |
tree | e870ff91fea06992a1605538a5ea45a104b7f3f6 | |
parent | 2d9732e18bb05f76cc65430f71035af321a756b0 (diff) |
Bugfixes
-rw-r--r-- | article_epub/publishers/nih.py | 8 | ||||
-rw-r--r-- | article_epub/publishers/oxford.py | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/article_epub/publishers/nih.py b/article_epub/publishers/nih.py index 7e0df3f..817ea41 100644 --- a/article_epub/publishers/nih.py +++ b/article_epub/publishers/nih.py @@ -29,7 +29,7 @@ class NIH(Publisher): self.get_citation() print('done') - def epubify(self): + def epubify(self,output=None): all_authors = '' for i in range(0,len(self.author_surnames)): @@ -38,7 +38,11 @@ class NIH(Publisher): if(i != (len(self.author_surnames) - 1)): all_authors += ', ' - self.output = self.author_surnames[0]+'_'+self.year+'.epub' + if output == None: + self.output = self.author_surnames[0]+'_'+self.year+'.epub' + else: + self.output = output + output_raw = '/tmp/raw.epub' pdf_link = self.soup.find('div',class_='format-menu') \ diff --git a/article_epub/publishers/oxford.py b/article_epub/publishers/oxford.py index aa0a431..b6a5f16 100644 --- a/article_epub/publishers/oxford.py +++ b/article_epub/publishers/oxford.py @@ -11,6 +11,11 @@ class Oxford(Publisher): def check_fulltext(self): if self.soup.find('div',{'data-widgetname':'ArticleFulltext'}) == None: sys.exit('Error: Can\'t access fulltext of article') + elif self.soup.find('span',{'id':'UserHasAccess'}) \ + ['data-userhasaccess'] == 'False': + sys.exit('Error: Can\'t access fulltext of article') + elif self.soup.find('div',class_='PdfOnlyLink') != None: + sys.exit('Error: Can\'t access fulltext of article') else: return(True) |