Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Bastet Massri   on Jan 19 In Java Category.

  
Question Answered By: Gorkem Yilmaz   on Jan 19

This code will help  u to read the html content of any web  page, but your
application must convert the acquired html to application  presentation, or u
may filter the html tags to get the data u need then display it as u want:

String line;
BufferedReader in;
try{
URL u = new URL("http://"+host+"/"+file);
In = new BufferedReader(new InputStreamReader(u.openStream()));
while ((line = in.readLine() != null)
{
System.out.println(line);
} } catch (MalformedURLException e) {e.printStackTrace();}
catch (IOException e) {e.printStackTrace();} }

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on localhost URL Or get search suggestion and latest updates.


Tagged: