Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-04-2008, 10:51 AM
Member
 
Join Date: Dec 2008
Posts: 4
Rep Power: 0
burian is on a distinguished road
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!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-04-2008, 10:54 AM
Senior Member
 
Join Date: Jun 2008
Posts: 1,397
Rep Power: 3
masijade is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-09-2008, 09:10 AM
Member
 
Join Date: Dec 2008
Posts: 4
Rep Power: 0
burian is on a distinguished road
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!
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-09-2008, 09:17 AM
Senior Member
 
Join Date: Jun 2008
Posts: 1,397
Rep Power: 3
masijade is on a distinguished road
Default
Have you even looked at the classes mentioned yet.

Use one for each of those ".dat" files, providing the complete url to it.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract A tar.gz file sajdutt Advanced Java 3 03-03-2009 10:29 AM
create a program that will extract particular records from a file acev New To Java 5 07-11-2008 04:26 AM
[SOLVED] How to Extract Data From this text file? jazz2k8 New To Java 31 04-18-2008 11:45 AM
Extract Text from PDF File using java TSW1016 Advanced Java 5 01-07-2008 12:03 AM
Help - problem with java when using internet badabing New To Java 1 08-07-2007 02:39 PM


All times are GMT +2. The time now is 09:22 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org