[tvsub] correction when empty result
This commit is contained in:
parent
a6298871f2
commit
f23a9ab4af
1 changed files with 11 additions and 10 deletions
|
|
@ -48,8 +48,9 @@ class SearchPage(BasePage):
|
||||||
""" Page which contains results as a list of series
|
""" Page which contains results as a list of series
|
||||||
"""
|
"""
|
||||||
def iter_subtitles(self,language):
|
def iter_subtitles(self,language):
|
||||||
list_result = self.parser.select(self.document.getroot(),'div.left_articles ul',1)
|
list_result = self.parser.select(self.document.getroot(),'div.left_articles ul')
|
||||||
li_result = self.parser.select(list_result,'li')
|
if len(list_result) > 0:
|
||||||
|
li_result = self.parser.select(list_result[0],'li')
|
||||||
for line in li_result:
|
for line in li_result:
|
||||||
if len(self.parser.select(line,'img[alt=%s]'%language)) > 0:
|
if len(self.parser.select(line,'img[alt=%s]'%language)) > 0:
|
||||||
link = self.parser.select(line,'a',1)
|
link = self.parser.select(line,'a',1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue