aspose file tools*
The moose likes Java in General and the fly likes Reading data from web sites Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reading data from web sites" Watch "Reading data from web sites" New topic
Author

Reading data from web sites

John Vorwald
Ranch Hand

Joined: Sep 26, 2010
Posts: 139
I am trying to read data from web sites.
I seem to have an error rate of about 0.1%.
Is this typical? What is the method/procedure to correct this type of error? Should multiple reads be done until a consistent value is obtained?

John
Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 177
    
    6

Define "error". What happens when there is an error?


Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
What does "read data from a web site" mean? What kind of client? What kind of data?
John Vorwald
Ranch Hand

Joined: Sep 26, 2010
Posts: 139
I'm reading Stock prices from Yahoo and TSP fund prices from thrift savings plan, Thrift Saving Plan Share Prices.
The error is that the historic stock, or fund, price changes since the last time I read it.

For example, I have previously read 19 Sep 2005 G Fund as "11.0100", and that value has previously passed a unit test of the type stock.getprice(date). However, that unit test just failed.

This may not be the best example, but in other cases, I have downloaded different prices for historical dates.

Code deleted, not isolated to the problem.
John Vorwald
Ranch Hand

Joined: Sep 26, 2010
Posts: 139
Generally speaking, the error is of the type that a different value is obtained for a fund at some point in the past. But, I always get a value, not just gibberish or garbled text.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
That's at least 500% more code than I think is reasonable to ask of people to try and make sense of :-)

Are the two files that give different results at different times identical? At a quick glance, it seems that you're scraping a web page, and web pages differ over time. If they' re not identical, then examining the differences will give you an idea of how to generalize your code so that it can deal with said differences.
John Vorwald
Ranch Hand

Joined: Sep 26, 2010
Posts: 139
I need to do more work to isolate the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading data from web sites