- for qnode in doc.findall('.//article/movie/file/qualities/qual'):
- http_url = xpath_text(
- qnode, './html_urls/video_url[@format="video/mp4"]')
+ for qnode in doc.findall(compat_xpath('.//article/movie/file/qualities/qual')):
+ http_url_ele = find_xpath_attr(
+ qnode, './html_urls/video_url', 'format', 'video/mp4')
+ http_url = http_url_ele.text if http_url_ele is not None else None