473,408 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to get data from webpage

yy
hi~~

I wanna write a java program that can get data from a webpage...
There are some figures frequently updated on the web...
I want to get the latest data and do some calculation, but I have no
ideas on how to get the data and how to know there is update on the
web

please help~~

thanks a lot!
Jul 17 '05 #1
3 13534
try looking at the URL class

"yy" <pi********@yahoo.com.hk> wrote in message
news:71************************@posting.google.com ...
hi~~

I wanna write a java program that can get data from a webpage...
There are some figures frequently updated on the web...
I want to get the latest data and do some calculation, but I have no
ideas on how to get the data and how to know there is update on the
web

please help~~

thanks a lot!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004
Jul 17 '05 #2
hi,

This can be done in perl

use LWP::Simple;
$htmlpage = get($url);

In java

URL url = new URL("$url");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedReader rd = new BufferedReader(new InputStreamReader
(conn.getInputStreamReader());

String line;
while(line=rd.readLine() != null) {
response += line;
}
The html page will be now available in the response String. This
String can then be used with the regex to solve according to our
requirement.

Hope that helps you.

Giridhar Nandigam.

pi********@yahoo.com.hk (yy) wrote in message news:<71************************@posting.google.co m>...
hi~~

I wanna write a java program that can get data from a webpage...
There are some figures frequently updated on the web...
I want to get the latest data and do some calculation, but I have no
ideas on how to get the data and how to know there is update on the
web

please help~~

thanks a lot!

Jul 17 '05 #3
- Have a look at HttpClient :
http://jakarta.apache.org/commons/httpclient

- The response header 'last-modified' will give you the last
modification date of the page.

pi********@yahoo.com.hk (yy) wrote in message news:<71************************@posting.google.co m>...
hi~~

I wanna write a java program that can get data from a webpage...
There are some figures frequently updated on the web...
I want to get the latest data and do some calculation, but I have no
ideas on how to get the data and how to know there is update on the
web

please help~~

thanks a lot!

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joey Martin | last post by:
My issue is two-fold. I need to download content on a webpage once a day and then parse the data. I know how to parse, so once I get the page, I'm ready to go. Here's my question. Is it...
1
by: teknowbabble | last post by:
I would like to know how to convert HTML code that users input into a TEXTAREA box on a HTML FORM into a separate WEBPAGE. I have something like the diagram below on my webpage. The user is...
1
by: Alex | last post by:
Hi, Everyday, I download data from a webpage and manually input data into my MS Access database. I am thinking of automate the routine by a VB script. The webpage I am visiting will return a...
4
by: news.microsoft.com | last post by:
Hi again, I am pretty new to ASP.net (I use to be a Visual Basic 6 addict) I want to do the following but I have been unable to find good info/ or sample code on it; please help; - retrieve a...
5
by: John Bradley | last post by:
Toooo tired to look this one up. I have data that I need to acces in a small program. The data is accessable from an ASP webpage that I created myself. If I need to see data from record #25, I...
10
by: sanou | last post by:
Hi does anyone know if the following is possible? I have an excel spreadsheet with values that i need transferred to a certain website's form. for instance, i have a value in excel spreadsheet...
6
by: shivavrata | last post by:
Hi All, I want to transfer the data form webpage to any other own application which is running in backend.How i develop this web page. which technology is good for this or any particular protocol...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
5
sid0404
by: sid0404 | last post by:
Hi I am new to the visualstudio.net I am trying to develop an application which requires me to send data to a HTML webpage - http://patft.uspto.gov/netahtml/PTO/search-bool.html and the user...
3
by: OldBirdman | last post by:
Access 2002 - Windows XP Home SP3 I want to get some data from a website. Currently I select the desired area of the webpage and copy to Clipboard. This selected area contains text and 2 imbedded...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.