Results 1 to 4 of 4
  1. #1
    burian is offline Member
    Join Date
    Dec 2008
    Posts
    4
    Rep Power
    0

    Default How to extract .dat file from the internet using Java?

    Hi all, I am new to Java.

    I want to know how to extract a list of historical stock price files (.dat format) from a particular stock website and insert the information into MySQL database using Java. I heard there is something called "HTML Parser".

    Can anyone help me with it? Thanks!

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    HTMLParser will only work for an already "downloaded" HTML page. What you need is Http(s)URLConnection to "get" the page/file in the first place. See the API docs for either HttpURLConnection or HttpsURLConnection, whichever is applicable.

    Edit: After that (i.e. what you do once you "get" it, depends on the format of the file. But guessing by the extension, it is not an html file, so HTMLParser will still not help.

  3. #3
    burian is offline Member
    Join Date
    Dec 2008
    Posts
    4
    Rep Power
    0

    Default

    ok, so lets say if I don't use HTML Parser, is there any other way that I can extract all the .dat files from a particular stock website? Thanks!

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Have you even looked at the classes mentioned yet.

    Use one for each of those ".dat" files, providing the complete url to it.

Similar Threads

  1. Extract A tar.gz file
    By sajdutt in forum Advanced Java
    Replies: 3
    Last Post: 03-03-2009, 09:29 AM
  2. Replies: 5
    Last Post: 07-11-2008, 03:26 AM
  3. [SOLVED] How to Extract Data From this text file?
    By jazz2k8 in forum New To Java
    Replies: 31
    Last Post: 04-18-2008, 10:45 AM
  4. Extract Text from PDF File using java
    By TSW1016 in forum Advanced Java
    Replies: 5
    Last Post: 01-06-2008, 11:03 PM
  5. Help - problem with java when using internet
    By badabing in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 01:39 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
  •