Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Java Internet Question


  • Please log in to reply
4 replies to this topic

#1 joejimbo

joejimbo

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:17 AM

Posted 05 September 2007 - 08:48 PM

Hi ya, as a practice program for java I wanted to copy the source file of a nutrition web site, mined all the data that I want and input it into a database to construct meal plans. I have a okay idea on what to do expect for download or even accessing a websites html source, I have a couple of books on JDBC so that'll be ok but i'm completey in the dark in java net functions. Also just for practice sake what other programming languages would be able to do a task like this?

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:10:17 PM

Posted 05 September 2007 - 09:20 PM

Ok, where to start... when you parse the HTML of another website, that is called screen-scraping. It's a rather poor way to get information from a website because anytime they change the format of their webpage, your application breaks. Even with dynamically generated webpages, screen scrapers are not terribly efficient because the number of elements fluctuates from page to page. Also, the content may have a copyright, so check you source.

Java doesn't have any 'functions'; it has classes and class methods. The only 'functions' that I am aware of are static methods. I 'm not at all sure what you mean by java net functions...

JDBC is simply Java Database Connectivity, and it is a specification for a programming interface. I'm sort of curious as to what books you have on the topic. Most J2EE books have a chapter or so that adequately covers the topic.

A web page is simply a text file, so all one needs to do is parse the text. Given that all 'real' languages deal with string manipulation, one could use pretty much any language that one wants.

#3 joejimbo

joejimbo
  • Topic Starter

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:17 AM

Posted 06 September 2007 - 01:24 PM

ah sorry about the terminology it's been a while since I programmed and I forgot. I didn't know about the screen-scraping thing and did some reserch which I found pretty interesting. I understand it's an issue of parsing the text which java has a multitude of packages and classes to deal with, my only problem with I have no starting point is with it's internet packages. I wouldn't know how to connect to a site and download it's source file, unless all I got to do is download the html file and open and parse through it with java's io classes which I have no clue how to accomplish that in java. If someone could point me to a sample program or a couple good tutorials dealing with java's net packages that would be great.

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:10:17 PM

Posted 06 September 2007 - 05:00 PM

All you have to do is to save the source file.

#5 joejimbo

joejimbo
  • Topic Starter

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:17 AM

Posted 06 September 2007 - 05:54 PM

I understand that, I just want to do it through java for the practice.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users