I want to extract texts from a html file that are placed between parapraph(p) and link(a href) tags.I want to do it without java regex and html parsers.I thougth
while ((word = reader.readLine()) !=null) { //iterate to the end of the file
if(word.contains("<p>")) { //catching p tag
while(!word.contains("</p>") { //iterate to the end of that tag
try { //start writing
out.write(word);
} catch (IOException e) {
}
}
}
}
But not working.The code seems pretty valid to me.How the reader can catch the "p" and "a href" tags.