private Elements parseEq(String query) { String value = getValue(query, EQ_TAG); int index = 0; try { index = Integer.parseInt(value); } catch (Exception e) { throw new IllegalArgumentException("Argument selector part: " + query + " is illegal", e); } return elements.eq(index); }
@Override protected String doInBackground(String... arg) { try { doc = Jsoup.connect(arg[0]).timeout(0).get(); elXkcdExp = doc.select("#mw-content-text table~p"); for (int i = 0; i < elXkcdExp.size(); i++) { outExp += elXkcdExp.eq(i).text() + "\n"; } } catch (IOException e) { Log.e(TAG, "Error in Jsoup"); // refresh(); } return outExp; }