java - Jsoup cyrillic letters in links and spaces. How to parse? -
i try parse images links, , there links cirillic letter. filenotfoundexception.
<img src="http://vao-priut.org/sites/default/files/images/ главной!.thumbnail.jpg">
and there space. how can solve it?
class parsepage extends asynctask<string,void,string>{ document doc=null; elements names,imgs; @override protected string doinbackground(string... params) { try { input = new url("http://vao-priut.org/category/fotokatalog/sektor"); string link = string.valueof(input); doc = jsoup.connect(link).get(); names = doc.select("table.col-3 div.views-field-title span.field-content a[href]"); imgs = doc.select("table.col-3 div.views-field-image-image span.field-content img"); (element img : imgs) { element myimage = img; string imgsrc = myimage.attr("src"); inputstream inp = new java.net.url(imgsrc).openstream(); // decode bitmap bitmap = bitmapfactory.decodestream(inp); allimages.add(bitmap); } (element name : names) { list.add(name.text()); } /* progressdialog mdialog = new progressdialog(getactivity()); mdialog.setmessage("please wait..."); mdialog.setcancelable(false); mdialog.show();*/ }catch(ioexception e){ e.printstacktrace(); } return text; } @override protected void onpostexecute(string result) { super.onpostexecute(result); sectoradapter = new sector_adapter(getactivity()); c_grid.setadapter(sectoradapter); image.setimagebitmap(allimages.get(0)); title.settext(list.get(0)); }
}
this code.
and there image errors
Comments
Post a Comment