My String page contain this page http://www.posh24.se/kandisar and I want to extract everything between
<div class="channelListEntry">
and
</div>
and put the result into an ArrayList
.
The things is the matcher.find()
always returns false
.
private ArrayList<String> extracted = new ArrayList<String>();
public void extractChannel(String htmlPage){
Pattern pattern = Pattern.compile("<div class=\"channelListEntry\">(.*?)</div>");
Matcher matcher = pattern.matcher(htmlPage);
while(matcher.find()){ // Always return false
System.out.println("hello ?");
extracted.add(matcher.group(1));
}
}
I expect to copy the text between tags in my array.