add a comment to explain why the SelectElementException is catched here
This commit is contained in:
parent
928dbcb16d
commit
e2c4c9f7e8
1 changed files with 1 additions and 0 deletions
|
|
@ -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'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue