• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading data from web sites

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Define "error". What happens when there is an error?
 
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Saloon Keeper
Posts: 7590
177
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to do more work to isolate the problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic