Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Getting Website Info
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Version




PostPosted: Thu Dec 13, 2007 4:22 pm   Post subject: Getting Website Info

I am wondering if there is a code that rretreives information from a webpage?

if so could someone provide the code for it thanks. Very Happy

I want to get numbers in group of 3's and are seperated by "," thanks.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Dec 13, 2007 4:23 pm   Post subject: RE:Getting Website Info

you want to get numbers, separated by commas, from a webpage?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Version




PostPosted: Thu Dec 13, 2007 4:27 pm   Post subject: RE:Getting Website Info

Yes im just wondering if it is possible?
HeavenAgain




PostPosted: Thu Dec 13, 2007 4:27 pm   Post subject: RE:Getting Website Info

getting thier site's information something like http://www.whois.sc/ ? you can even find Dan's number there Surprised

but i doubt you can do that with code/java

but define this number that you are looking for please.
Version




PostPosted: Thu Dec 13, 2007 4:35 pm   Post subject: RE:Getting Website Info

Well here is the format type thing

111212 123124 34353, 12312 34134 45454,

and so on..

im trying to find the url.
rdrake




PostPosted: Thu Dec 13, 2007 4:36 pm   Post subject: Re: Getting Website Info

You can very easily download a web page with Java:
Java:
        try {
            HttpURLConnection urlc = (HttpURLConnection)(new URL("http://compsci.ca/")).openConnection();
            urlc.connect();

            DataInputStream d = new DataInputStream(urlc.getInputStream());
            byte[] b = new byte[urlc.getContentLength()];
            d.readFully(b);

            d.close();
            urlc.disconnect();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
It downloads all the content into a byte array, which you must then turn into strings. Afterwards you can scrape the resulting HTML in the strings in order to find what you need.

I think the HttpURLConnection and DataInputStream are in the java.net and java.io packages, respectively.
Version




PostPosted: Thu Dec 13, 2007 4:38 pm   Post subject: RE:Getting Website Info

interesting but right now im not trying to download but just trying to retrieve some data from it

http://hiscore.runescape.com/index_lite.ws?player=spike_x41

that is the url to get the information from that i am trying to do.
Tony




PostPosted: Thu Dec 13, 2007 4:51 pm   Post subject: RE:Getting Website Info

download and retrieve (all of) data from a webpage are the same thing.

so you read the webpage, and then you can parse whatever specific data that you need from it.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
HeavenAgain




PostPosted: Thu Dec 13, 2007 4:55 pm   Post subject: RE:Getting Website Info

well, if you want to modify runescape... thats not the way to do it Neutral
those number have nothing to do with any "hacks"
Version




PostPosted: Thu Dec 13, 2007 5:42 pm   Post subject: RE:Getting Website Info

I want to make a program to retreive the website highscore.. when one is entered
HeavenAgain




PostPosted: Thu Dec 13, 2007 5:49 pm   Post subject: RE:Getting Website Info

by looking at the url link you give from your post http://hiscore.runescape.com/index_lite.ws?player=spike_x41
god knows what does number means, so how is it able to get the highscore? unless you know what it means, then you still have to download the webpage, and do some work there
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: