reader.readLines().filter(String::isNotBlank).toList() val token = Jsoup.parse(result.toString()) .select("form input[name=authenticity_token]").attr("value") } .subscribeBy( onNext = { val reader = BufferedReader(InputStreamReader(it.byteStream())) val result = reader.readLines().filter(String::isNotBlank).toList() val alert = Jsoup.parse(result.toString()) .select(“div.container li.bm-flash-item—alert").isNotEmpty() if (alert) { Timber.i("E-mail or Password is wrong") contract.failureLogin() return@subscribeBy } }, onError = { Timber.e(it, it.message) } )