Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7731391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:28:04+00:00 2026-06-01T06:28:04+00:00

i’m looking to parse the real time rates from this webpage: http://www.truefx.com/ into my

  • 0

i’m looking to parse the real time rates from this webpage: http://www.truefx.com/ into my java programs, ie, i want the data from the webpage that is refreshed on a second by second basis to be constantly streamed into my program.

I would like to do this using the standard java libraries, if possible. i’m aware of plugins like jsoup and possibly others, but i’d like to not have to download and install the plugins as the computer i’m using’s hard drive is based in california and everything but a few core programs, eclipse being on of them, gets deleted every night when the system restarts.

So if anyone knows of a package in the standard eclipse download that can do this, please let me know! thanks


ok so i got this working, but it seems very slow. for example the data will change on a second by second basis, and even though i’m refreshing the webpage that i read from on a second by second basis also (i used thread.sleep(1000)), and then get a new instance of the webpage, it only updates once every minute or so. what gives?

here’s what my code looks like (i used what you posted above as my url reader) :

 public String getPage(String urlString){
        String result = "";
        //Access the page
        try {
         // Create a URL for the desired page
         URL url = new URL(urlString);
         // Read all the text returned by the server
         BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
         String str;
         while ((str = in.readLine()) != null) {
             // str is one line of text; readLine() strips the newline character(s)
             result += str;
         }
         in.close();             
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        }          
        return result;
    }

    public static void main(String[]args){
        int i =0;
        Reading r = new Reading();

    while(true){
        try{Thread.sleep(1000);}catch(Exception e){}
        String page = new String(r.getPage("http://www.fxstreet.com/rates-charts/forex-rates/"));
        int index = page.indexOf("last_3212166");
        //System.out.println(i+page);
        i++;
        System.out.println(i+"GBP/USD: "+page.substring(index+14,index+20));
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:28:05+00:00Added an answer on June 1, 2026 at 6:28 am

    With no external API you can get the page by this function just with importing java.net.URL

    static public String getPage(String urlString){
        String result = "";
        //Access the page
        try {
         // Create a URL for the desired page
         URL url = new URL(urlString);
         // Read all the text returned by the server
         BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
         String str;
         while ((str = in.readLine()) != null) {
             // str is one line of text; readLine() strips the newline character(s)
             result += str;
         }
         in.close();             
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        }          
        return result;
    }
    

    Then use the java.util.regex to match the data that you want to get from the page. and parse it into your labels. Don’t forget to put all this in a thread with a while(true) loop, and a sleep(some_time) to have second by second informations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.