def get_subtitle_download_url(response_content): download_url = "" parser = MyHTMLParser() parser.feed(response_content) for attr in parser.attrs: attr_name, attr_value = attr if attr_name == "src" and attr_value.find(SUBTITLE_PAGE) >= 0: download_url = SUBTITLE_DOWNLOAD_URL % attr_value break parser.close() return download_url