add remove space if no result

This commit is contained in:
vincent 2019-05-14 21:28:29 +02:00
parent 815cb2513d
commit 45a6369b34

View File

@ -33,6 +33,9 @@ class Emmission(object):
pass
strsearch=strsearch.replace('É','E')
linkchaine=self.html.find(text=re.compile(re.escape(strsearch)))
if linkchaine == None:
strsearch=strsearch.replace(" ","")
linkchaine=self.html.find(text=re.compile(re.escape(strsearch)))
if linkchaine == None:
return "can't find channel"
link = linkchaine.parent.parent.find_next_sibling().find("a")