def parse_story(self, url): """Download HTML fron URL and parse it.""" html = self._get_html_for_url(url) parser = FanfictionNetParser() parse_result = parser.parse(html) return JsonView(parse_result.is_successful(), parse_result.as_json())
def _parse_result_for_file(path): story_html = contents_of(path) parser = FanfictionNetParser() parse_result = parser.parse(story_html) return parse_result