This commit is contained in:
Kovid Goyal 2014-12-06 08:47:20 +05:30
parent 30ebdfe1f3
commit 710c0d5def
2 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,5 @@
from calibre.web.feeds.jsnews import JavascriptRecipe
from calibre.web.jsbrowser.browser import NotAFile
try:
from calibre.web.feeds.jsnews import CSSSelect
@ -152,7 +153,10 @@ class WSJ(JavascriptRecipe):
break
for a in CSSSelect('div.itpSectionHeaderPdf a[href]')(root):
href = a.get('href')
ans['cover'] = browser.download_file(href)
try:
ans['cover'] = browser.download_file(href)
except NotAFile:
break
break
feeds = ans['index'] = []

View File

@ -1,4 +1,5 @@
from calibre.web.feeds.jsnews import JavascriptRecipe
from calibre.web.jsbrowser.browser import NotAFile
try:
from calibre.web.feeds.jsnews import CSSSelect
@ -147,7 +148,10 @@ class WSJ(JavascriptRecipe):
break
for a in CSSSelect('div.itpSectionHeaderPdf a[href]')(root):
href = a.get('href')
ans['cover'] = browser.download_file(href)
try:
ans['cover'] = browser.download_file(href)
except NotAFile:
break
break
feeds = ans['index'] = []