Re: A programme to receive the HTML code from a URL

From: Liz (Liz_at_nospam.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 03:20:13 GMT

there are lots of examples around on the web
just waiting for you to search for them

"Raymond DeCampo" <rdecampo@spam.twcny.spam.rr.spam.com.spam> wrote in
message news:A0ikc.124048$M3.69864@twister.nyroc.rr.com...
> XMLSDK wrote:
> > I have written a programme to receive the HTML code from a URL
> > http://www.pru.com.hk/
> > But I dunno why it doesn't work. It can only receive the beginning few
> > lines:
> >
> > <!-- i n clude file="BB.asp" -->
> >
> > And the remaining cannot be obtained. Can anyone help me with this
problem?
> > Thank you.
> >
> >
> > import java.io.*;
> > import java.net.URL;
> > import java.net.URLConnection;
> >
> > public class App {
> >
> > public static void main(String[] args) {
> > BufferedReader br = null;
> > try
> > {
> > URL url = new URL("http://www.pru.com.hk/");
> > URLConnection urlConn = url.openConnection();
> > InputStreamReader isr = new
InputStreamReader(urlConn.getInputStream());
> > br = new BufferedReader(isr);
> >
> > String str;
> > while ((str = br.readLine()) != null)
> > {
> > System.out.println(str);
> > }
> > }
> > catch (IOException e)
> > {
> > System.err.println(e);
> > }
> > finally
> > {
> > try
> > {
> > if (br != null) br.close();
> > }
> > catch (IOException e)
> > {
> > System.err.println(e);
> > }
> > }
> > }
> > }
> >
> >
>
> My guess would be that the response is encoded in a character set
> different from the default character set on your system. Try reading
> the response as a binary stream and same it to a file and see if the
> results differ.
>
> Ray
>
>



Relevant Pages

  • Re: who persists awkwardly, when Alice elects the raw hope in the interior
    ... rams unless Lisette will else throw afterwards. ... follow internal and delays our associated, ... Otherwise the waiting in Faris's beast might tap some easy cylinders. ... flee at present the bulb in response to the architecture. ...
    (sci.crypt)
  • they practise the lucky sink and see it inside its corner
    ... When did Charlene export the ... waiting in response to the full advertisement? ...
    (sci.crypt)
  • Re: Long Term Impact on Golf
    ... there were a lot of folks waiting around waiting to be "invited" to help or ... You mention the National Guard needing supplies for themselves. ... New Orleans is at the southern end of a wide area ... >> The US could have done better in response to this catasophe. ...
    (rec.sport.golf)
  • Re: New Orleans and global warming (was Re: OT: I dont believe it!!!)
    ... >>Your idea of an appropriate response to a disaster that has killed ... >>government while belittling the scale of the disaster and seeking to ... >>do hold your breath waiting for an apology. ...
    (uk.rec.cycling)
  • Re: Transactional Replication Timeout Problems
    ... transactions for it to ever catch up. ... The problem I am getting is that after going through the replication process ... there with the message 'The process is running and is waiting for a response ...
    (microsoft.public.sqlserver.replication)