I am using java to fetch the title text from web page.
I have fetched image from web page using Tag name as follows:
int i=1;
InputStream in=new URL("www.yahoo.com").openStream();
org.w3c.dom.Document doc= new Tidy().parseDOM(in, null);
NodeList img=doc.getElementsByTagName("img");
ArrayList<String> list=new ArrayList<String>();
list.add(img.item(i).getAttributes().getNamedItem("src").getNodeValue());
It is working,But I want to fetch title tag from web page(www.yahoo.com) using same code as above.I have mentioned getElementsByTagName("title"); but it is not working. Please help me,how to do that using jtidy parser as above.