aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Kellner <ken@kenkellner.com>2018-04-24 16:33:40 -0400
committerKen Kellner <ken@kenkellner.com>2018-04-24 16:33:40 -0400
commit2d9732e18bb05f76cc65430f71035af321a756b0 (patch)
treea4e24fca4b98a4b4931a0e44ace9e12e776abd3c
parentace395fc372ead82216af906aee1c97dfea821ca (diff)
Some bugfixes for formulas
-rw-r--r--article_epub/publishers/uchicago.py5
-rw-r--r--article_epub/publishers/wiley.py17
2 files changed, 15 insertions, 7 deletions
diff --git a/article_epub/publishers/uchicago.py b/article_epub/publishers/uchicago.py
index 9492e75..b097787 100644
--- a/article_epub/publishers/uchicago.py
+++ b/article_epub/publishers/uchicago.py
@@ -67,6 +67,11 @@ class UChicago(Publisher):
link = 'https://www.journals.uchicago.edu'+img['src']
img['src'] = link
+ for i in body_raw.find_all('span',class_='formula-display'):
+ img = i.find('img')
+ link = 'https://www.journals.uchicago.edu'+img['src']
+ img['src'] = link
+
self.body = str(body_raw)
def get_references(self):
diff --git a/article_epub/publishers/wiley.py b/article_epub/publishers/wiley.py
index 9f08c59..ca4a64e 100644
--- a/article_epub/publishers/wiley.py
+++ b/article_epub/publishers/wiley.py
@@ -13,15 +13,18 @@ class Wiley(Publisher):
def check_fulltext(self):
full = self.soup.find('section',class_='article-section__full')
- if full != None:
- if full.find('div',class_='article-section__content') \
- .text == '\n\xa0\n':
- sys.exit('Error: Can\'t access fulltext of article')
+ try:
+ if full != None:
+ if full.find('div',class_='article-section__content') \
+ .text == '\n\xa0\n':
+ sys.exit('Error: Can\'t access fulltext of article')
+ else:
+ return(True)
else:
- return(True)
- else:
+ sys.exit('Error: Can\'t access fulltext of article')
+ except:
sys.exit('Error: Can\'t access fulltext of article')
-
+
def get_doi(self):
if self.doi == None:
doi_raw = self.soup.find('a',class_='epub-doi').text.split('/')