mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
299e176264
commit
68beb72bbd
@ -1,4 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||||
|
|
||||||
@ -8,6 +11,7 @@ class JASN(BasicNewsRecipe):
|
|||||||
__author__ = 'Krittika Goyal'
|
__author__ = 'Krittika Goyal'
|
||||||
oldest_article = 31 #days
|
oldest_article = 31 #days
|
||||||
max_articles_per_feed = 25
|
max_articles_per_feed = 25
|
||||||
|
delay = 5
|
||||||
needs_subscription = True
|
needs_subscription = True
|
||||||
|
|
||||||
INDEX = 'http://jasn.asnjournals.org/current.shtml'
|
INDEX = 'http://jasn.asnjournals.org/current.shtml'
|
||||||
@ -102,9 +106,17 @@ class JASN(BasicNewsRecipe):
|
|||||||
continue
|
continue
|
||||||
if url.startswith('/'):
|
if url.startswith('/'):
|
||||||
url = 'http://jasn.asnjournals.org'+url
|
url = 'http://jasn.asnjournals.org'+url
|
||||||
|
img = isoup = None
|
||||||
|
try:
|
||||||
isoup = self.index_to_soup(url)
|
isoup = self.index_to_soup(url)
|
||||||
img = isoup.find('img', src=lambda x: x and
|
except:
|
||||||
x.startswith('/content/'))
|
time.sleep(5)
|
||||||
|
try:
|
||||||
|
isoup = self.index_to_soup(url)
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
img = isoup.find('img', src=lambda x: x and x.startswith('/content/'))
|
||||||
|
|
||||||
if img is not None:
|
if img is not None:
|
||||||
img.extract()
|
img.extract()
|
||||||
table = a.findParent('table')
|
table = a.findParent('table')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user