extractBasicInfo function

Future<BasicInfo> extractBasicInfo(
  1. BeautifulSoup soup
)

Implementation

Future<BasicInfo> extractBasicInfo(BeautifulSoup soup) async {
  String? src = soup
      .find("img", id: "s_m_HeaderContent_picctrlthumbimage")!
      .attributes['src'];
  String pictureId = "";
  if (src != null && src.contains("pictureid")) {
    pictureId = queriesFromSoup(src)['pictureid'] ?? "";
  }
  String nameWithExtra =
      soup.find('div', id: "s_m_HeaderContent_MainTitle")!.text;
  String name = nameWithExtra.substring(
      nameWithExtra.indexOf('n') + 2, nameWithExtra.indexOf(','));
  return BasicInfo(name, pictureId);
}