diff --git a/src/getUrlResults.java b/src/getUrlResults.java index f15d495..0f7fabf 100644 --- a/src/getUrlResults.java +++ b/src/getUrlResults.java @@ -14,14 +14,13 @@ public static List getWordsList(List linesList, String searchText) { List resultList = new ArrayList(); + String lookForText = "Visa mer information om ")) { - passedLine = true; - } - if (passedLine) { - System.out.println(line); + //if (line.contains("Visa mer information om ")) { + + if (line.contains(lookForText)) { + System.out.println(line.substring(lookForText.length() + 2, lookForText.length() + 2 + searchText.length())); resultList.add(line); } } @@ -42,12 +41,10 @@ is = url.openStream(); // throws an IOException br = new BufferedReader(new InputStreamReader(is)); - while ((line = br.readLine()) != null) { lines.add(line); } - } catch (MalformedURLException mue) { mue.printStackTrace(); } catch (IOException ioe) {