Results 1 to 7 of 7
- 07-23-2011, 02:30 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 14
- Rep Power
- 0
please help urgent (get text from webpage)
i have this code to get the ip address
import java.net.*;
import java.io.*;
public class mk {
public static void main(String [] args) {
try {
URL whatismyip = new URL("http://automation.whatismyip.com/n09230945.asp");
BufferedReader in = new BufferedReader(new InputStreamReader(
whatismyip.openStream()));
String ip = in.readLine(); //you get the IP as a String
System.out.println(ip);
}
catch(Exception e) {
e.printStackTrace();
}
}
}
========================
that is ok because that page (http://automation.whatismyip.com/n09230945.asp) contains only the ip address,,,
what i want is to get the ip address ,, from (What Is My IP Address? Lookup IP, Hide IP, Change IP, Trace IP and more...) not from(http://automation.whatismyip.com/n09230945.asp)....
in other words i want to read certain line ,, in a web page ,,, not all lines
thanks please help
-
What is so urgent about this question? Why do you consider it more important than the other questions on this site?
- 07-23-2011, 02:44 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 14
- Rep Power
- 0
it is urgent for me ,,
- 07-23-2011, 02:49 PM #4
Go through the second link in Fubarable's signature -- particularly the part of thepage that deals with urgent queries.
db
-
The reason behind my statement is that your urgency is yours alone and not ours. We are all volunteers, not paid consultants, and no one likes to feel pressured or rushed, least of all volunteers. We feel that all questions here are important, not just yours. So please leave your urgency out of your question and title as it can often have the opposite effect intended -- stating your urgency can cause many here to actively avoid answering your questions.
Regarding your problem, you have to read all lines until you find your line of interest. You can read line by line as text until you find what you're looking for or you could use an HTML parsing library if you needed to parse the text received (e.g., JTidy, JSoup, and TagSoup among others).Last edited by Fubarable; 07-23-2011 at 03:30 PM.
- 07-23-2011, 03:23 PM #6
Member
- Join Date
- Jan 2011
- Posts
- 14
- Rep Power
- 0
thanks Fubarable
and i am sorry
- 07-24-2011, 08:29 AM #7
Member
- Join Date
- May 2011
- Posts
- 35
- Rep Power
- 0
Similar Threads
-
Need Urgent Help in Writing a Cell range in a Text File
By Anagha in forum New To JavaReplies: 5Last Post: 03-25-2011, 08:02 AM -
loading webpage
By juhiswt in forum New To JavaReplies: 0Last Post: 03-17-2011, 06:37 PM -
Serving up a Webpage
By kammce in forum NetworkingReplies: 7Last Post: 01-01-2011, 02:57 AM -
[URGENT]SHA Encryption System...need urgent helps
By java_idiot in forum New To JavaReplies: 6Last Post: 05-02-2010, 10:04 AM -
COMBINATION TEXT..help me..urgent
By conv_bay in forum New To JavaReplies: 10Last Post: 04-27-2009, 11:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks