Good day. I have an android application in which I am going to place pictures from one site.

I know that Jsoup / Gson is suitable for parsing.

The pictures on the site are stored in a div block (such as an item sheet) in which other divs are nested, in which the url to the picture is registered in the style attribute (background-image).

Example:

<div class="itemlist"> <div class="pic1"> <div style="background-image: url("путь к картинке")"></div> <div class="pic2"> <div style="background-image: url("путь к картинке")"> </div> <div class="pic3"> <div style="background-image: url("путь к картинке")"> </div> ... <div class="picN"> <div style="background-image: url("путь к картинке")"> </div> </div> 

If there is, who can parse such things using the above libraries, tell me, please, how to parse these pictures?

And another question, is it necessary to create a separate AsyncTask for parsing using these libraries?

  • 2
    1. GSON does not fit, it parses JSON, not HTML. 2. choose all the elements you are interested in according to your criterion, take to each style, and have style - background-image - Vladyslav Matviienko
  • Can I do this with Jsoup? - Crok
  • can. And the use of AsyncTask depends on the implementation. - Vladyslav Matviienko
  • The implementation is as follows: I have a Recyclerview into which the pictures will be loaded. Pictures can be as pleasing set. - Crok

0