Results 1 to 7 of 7
  1. #1
    3ammary is offline Member
    Join Date
    Jan 2011
    Posts
    14
    Rep Power
    0

    Angry 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

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    What is so urgent about this question? Why do you consider it more important than the other questions on this site?

  3. #3
    3ammary is offline Member
    Join Date
    Jan 2011
    Posts
    14
    Rep Power
    0

    Default

    it is urgent for me ,,

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,240
    Rep Power
    19

    Default

    Go through the second link in Fubarable's signature -- particularly the part of thepage that deals with urgent queries.

    db

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  6. #6
    3ammary is offline Member
    Join Date
    Jan 2011
    Posts
    14
    Rep Power
    0

    Default

    thanks Fubarable
    and i am sorry

  7. #7
    jing-yi is offline Member
    Join Date
    May 2011
    Posts
    35
    Rep Power
    0

    Default

    It is not convenient to get it from an external page that will subject to change from time to time.

    Can I know why you do not prefer the first url address?

Similar Threads

  1. Replies: 5
    Last Post: 03-25-2011, 08:02 AM
  2. loading webpage
    By juhiswt in forum New To Java
    Replies: 0
    Last Post: 03-17-2011, 06:37 PM
  3. Serving up a Webpage
    By kammce in forum Networking
    Replies: 7
    Last Post: 01-01-2011, 02:57 AM
  4. [URGENT]SHA Encryption System...need urgent helps
    By java_idiot in forum New To Java
    Replies: 6
    Last Post: 05-02-2010, 10:04 AM
  5. COMBINATION TEXT..help me..urgent
    By conv_bay in forum New To Java
    Replies: 10
    Last Post: 04-27-2009, 11:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •