parsePhrasePageData function

PhrasePageScrapeResult parsePhrasePageData(
  1. String pageHtml,
  2. String query
)

Parses a jisho word search page to an object

Implementation

PhrasePageScrapeResult parsePhrasePageData(String pageHtml, String query) {
  final document = parse(pageHtml);

  if (!_resultWasFound(document)) {
    return PhrasePageScrapeResult(query: query);
  }

  return PhrasePageScrapeResult(
    query: query,
    data: _getMeaningsOtherFormsAndNotes(query, document),
  );
}