This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading data from web sites

 
John Vorwald
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Define "error". What happens when there is an error?
 
Tim Moores
Bartender
Posts: 2802
39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "read data from a web site" mean? What kind of client? What kind of data?
 
John Vorwald
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2802
39
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to do more work to isolate the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic