add a comment to explain why the SelectElementException is catched here

This commit is contained in:
Romain Bignon 2010-11-20 19:52:55 +01:00
commit e2c4c9f7e8

View file

@ -35,6 +35,7 @@ class SearchPage(BasePage):
try:
ul = select(self.document.getroot(), 'div.container-videos ul', 1)
except SelectElementException:
# It means there are no results.
return
for li in ul.findall('li'):
id = re.sub(r'/video/(.+)\.html', r'\1', li.find('a').attrib['href'])