我开始学习 Flutter,并通过制作自己的manga阅读应用程序来实现这一目标,在该应用程序中,我从我最常使用的网站上抓取所有数据。
我的问题是,由于此错误,只有我读到的其中一篇mangas无法抓取数据:
FormatException (FormatException: Bad UTF-8 encoding 0x22 (at offset 369))\nRun Code Online (Sandbox Code Playgroud)\n\n我的爬虫代码:
\n\n Future<Manga> getMangaInfo(source) async{\n final response = await _client.get(source);\n var manga;\n print(response.body);//error occurs here\n final document = parse(response.body);\n\n final mangaInfo = document.getElementsByClassName(\'tamanho-bloco-perfil\');\n for(Element infos in mangaInfo){\n final infoCont = infos.getElementsByClassName(\'row\');\n //get titulo\n Element tituloCont = infoCont[0];\n final tituloH = tituloCont.getElementsByTagName(\'h2\');\n Element tituloCont2 = tituloH[0];\n String titulo = \'[\'+tituloCont2.text+\']\';\n //print(titulo);\n\n //get capa\n\n Element capaCont = infoCont[2];\n final capaImg = capaCont.getElementsByTagName(\'img\');\n …Run Code Online (Sandbox Code Playgroud)