You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Suladna <su...@yahoo.com> on 2008/08/01 17:52:43 UTC
Reading html-code from many different websites
Hi
I am making a Java-program that should read the html-code from several different websites. I am currently using this tutorial to read from one website:
http://hc.apache.org/httpclient-3.x/tutorial.html
My question is: do I really have to release and restart the connection after every website I read? As there are so many websites it would be good if I could instead redefine the HttpMethod instead of creating a new one for each site. Is this possible?
Or is it possible to in some way connect to all the websites at the same time?
Thanks in advance
RE: Reading html-code from many different websites
Posted by Rudy Rusli <ra...@hotmail.com>.
Hello,
I'm trying to unsubscribe to this mailing list:
I sent email to : httpclient-users-unsubscribe@hc.apache.org a couple of times but always fail. Can someone please assist me?
Thanks
> Date: Sat, 2 Aug 2008 04:43:42 -0700
> From: suladna@yahoo.com
> Subject: Re: Reading html-code from many different websites
> To: httpclient-users@hc.apache.org
>
>
> Thanks Quintin. I found an example named connection management, but it seems to do pretty much the same job as the old HC, with one site at the time?
>
> http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java
>
> The sites I want to connect to all start with http://www.xxxxxxxxxxxxx.se/Templates/InsynPersonVisaInnehavPage____3097.aspx?insynsperson_id=
>
> but they have different endings. Should I make a new httpget for each site I want to access even if they are all under the same domain name?
>
>
>
>
> --- On Fri, 8/1/08, Quintin Beukes <qu...@last.za.net> wrote:
>
> From: Quintin Beukes <qu...@last.za.net>
> Subject: Re: Reading html-code from many different websites
> To: "HttpClient User Discussion" <ht...@hc.apache.org>, suladna@yahoo.com
> Date: Friday, August 1, 2008, 9:12 PM
>
> Hey,
>
> Beyond this, if you wish to use HC4, have a look at:
> http://hc.apache.org/httpcomponents-client/index.html
>
> Download at:
> http://hc.apache.org/downloads.cgi
>
> You need both http core and client. Then inside the client there is an
> examples directory. Use one of the basic examples as your basic
> structure. Pick on with connection management, unless you only fetch a
> max of one file per site. If you fetch more than one file per site,
> then connection management is a good idea for performance.
>
> Quintin
>
> On Fri, Aug 1, 2008 at 11:09 PM, Quintin Beukes <qu...@last.za.net>
> wrote:
> > Hey,
> >
> > Why not use httpclient 4? For new code it's probably the best option.
> > It's API is much stronger, and it's connection management will fit
> in
> > well with your requirements.
> >
> > Quintin
> >
> > On Fri, Aug 1, 2008 at 5:52 PM, Suladna <su...@yahoo.com> wrote:
> >> Hi
> >>
> >> I am making a Java-program that should read the html-code from several
> different websites. I am currently using this tutorial to read from one website:
> >>
> >> http://hc.apache.org/httpclient-3.x/tutorial.html
> >>
> >> My question is: do I really have to release and restart the connection
> after every website I read? As there are so many websites it would be good if I
> could instead redefine the HttpMethod instead of creating a new one for each
> site. Is this possible?
> >>
> >> Or is it possible to in some way connect to all the websites at the
> same time?
> >>
> >> Thanks in advance
> >>
> >>
> >>
> >
> >
> >
> > --
> > Quintin Beukes
> >
>
>
>
> --
> Quintin Beukes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
>
>
>
_________________________________________________________________
Get more from your digital life. Find out how.
http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home2_082008
Re: Reading html-code from many different websites
Posted by Quintin Beukes <qu...@last.za.net>.
Hey,
Use this example:
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientExecuteDirect.java
Then you can leave everything the same, and use for each different URL
your own version of createRequest().
Also, i can't view the site with the links you gave in your last message.
Quintin
On Sat, Aug 2, 2008 at 1:43 PM, Suladna <su...@yahoo.com> wrote:
>
> Thanks Quintin. I found an example named connection management, but it seems to do pretty much the same job as the old HC, with one site at the time?
>
> http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java
>
> The sites I want to connect to all start with http://www.xxxxxxxxxxxxx.se/Templates/InsynPersonVisaInnehavPage____3097.aspx?insynsperson_id=
>
> but they have different endings. Should I make a new httpget for each site I want to access even if they are all under the same domain name?
>
>
>
>
> --- On Fri, 8/1/08, Quintin Beukes <qu...@last.za.net> wrote:
>
> From: Quintin Beukes <qu...@last.za.net>
> Subject: Re: Reading html-code from many different websites
> To: "HttpClient User Discussion" <ht...@hc.apache.org>, suladna@yahoo.com
> Date: Friday, August 1, 2008, 9:12 PM
>
> Hey,
>
> Beyond this, if you wish to use HC4, have a look at:
> http://hc.apache.org/httpcomponents-client/index.html
>
> Download at:
> http://hc.apache.org/downloads.cgi
>
> You need both http core and client. Then inside the client there is an
> examples directory. Use one of the basic examples as your basic
> structure. Pick on with connection management, unless you only fetch a
> max of one file per site. If you fetch more than one file per site,
> then connection management is a good idea for performance.
>
> Quintin
>
> On Fri, Aug 1, 2008 at 11:09 PM, Quintin Beukes <qu...@last.za.net>
> wrote:
>> Hey,
>>
>> Why not use httpclient 4? For new code it's probably the best option.
>> It's API is much stronger, and it's connection management will fit
> in
>> well with your requirements.
>>
>> Quintin
>>
>> On Fri, Aug 1, 2008 at 5:52 PM, Suladna <su...@yahoo.com> wrote:
>>> Hi
>>>
>>> I am making a Java-program that should read the html-code from several
> different websites. I am currently using this tutorial to read from one website:
>>>
>>> http://hc.apache.org/httpclient-3.x/tutorial.html
>>>
>>> My question is: do I really have to release and restart the connection
> after every website I read? As there are so many websites it would be good if I
> could instead redefine the HttpMethod instead of creating a new one for each
> site. Is this possible?
>>>
>>> Or is it possible to in some way connect to all the websites at the
> same time?
>>>
>>> Thanks in advance
>>>
>>>
>>>
>>
>>
>>
>> --
>> Quintin Beukes
>>
>
>
>
> --
> Quintin Beukes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
>
>
>
--
Quintin Beukes
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: Reading html-code from many different websites
Posted by Suladna <su...@yahoo.com>.
Thanks Quintin. I found an example named connection management, but it seems to do pretty much the same job as the old HC, with one site at the time?
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java
The sites I want to connect to all start with http://www.xxxxxxxxxxxxx.se/Templates/InsynPersonVisaInnehavPage____3097.aspx?insynsperson_id=
but they have different endings. Should I make a new httpget for each site I want to access even if they are all under the same domain name?
--- On Fri, 8/1/08, Quintin Beukes <qu...@last.za.net> wrote:
From: Quintin Beukes <qu...@last.za.net>
Subject: Re: Reading html-code from many different websites
To: "HttpClient User Discussion" <ht...@hc.apache.org>, suladna@yahoo.com
Date: Friday, August 1, 2008, 9:12 PM
Hey,
Beyond this, if you wish to use HC4, have a look at:
http://hc.apache.org/httpcomponents-client/index.html
Download at:
http://hc.apache.org/downloads.cgi
You need both http core and client. Then inside the client there is an
examples directory. Use one of the basic examples as your basic
structure. Pick on with connection management, unless you only fetch a
max of one file per site. If you fetch more than one file per site,
then connection management is a good idea for performance.
Quintin
On Fri, Aug 1, 2008 at 11:09 PM, Quintin Beukes <qu...@last.za.net>
wrote:
> Hey,
>
> Why not use httpclient 4? For new code it's probably the best option.
> It's API is much stronger, and it's connection management will fit
in
> well with your requirements.
>
> Quintin
>
> On Fri, Aug 1, 2008 at 5:52 PM, Suladna <su...@yahoo.com> wrote:
>> Hi
>>
>> I am making a Java-program that should read the html-code from several
different websites. I am currently using this tutorial to read from one website:
>>
>> http://hc.apache.org/httpclient-3.x/tutorial.html
>>
>> My question is: do I really have to release and restart the connection
after every website I read? As there are so many websites it would be good if I
could instead redefine the HttpMethod instead of creating a new one for each
site. Is this possible?
>>
>> Or is it possible to in some way connect to all the websites at the
same time?
>>
>> Thanks in advance
>>
>>
>>
>
>
>
> --
> Quintin Beukes
>
--
Quintin Beukes
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: Reading html-code from many different websites
Posted by Quintin Beukes <qu...@last.za.net>.
Hey,
Beyond this, if you wish to use HC4, have a look at:
http://hc.apache.org/httpcomponents-client/index.html
Download at:
http://hc.apache.org/downloads.cgi
You need both http core and client. Then inside the client there is an
examples directory. Use one of the basic examples as your basic
structure. Pick on with connection management, unless you only fetch a
max of one file per site. If you fetch more than one file per site,
then connection management is a good idea for performance.
Quintin
On Fri, Aug 1, 2008 at 11:09 PM, Quintin Beukes <qu...@last.za.net> wrote:
> Hey,
>
> Why not use httpclient 4? For new code it's probably the best option.
> It's API is much stronger, and it's connection management will fit in
> well with your requirements.
>
> Quintin
>
> On Fri, Aug 1, 2008 at 5:52 PM, Suladna <su...@yahoo.com> wrote:
>> Hi
>>
>> I am making a Java-program that should read the html-code from several different websites. I am currently using this tutorial to read from one website:
>>
>> http://hc.apache.org/httpclient-3.x/tutorial.html
>>
>> My question is: do I really have to release and restart the connection after every website I read? As there are so many websites it would be good if I could instead redefine the HttpMethod instead of creating a new one for each site. Is this possible?
>>
>> Or is it possible to in some way connect to all the websites at the same time?
>>
>> Thanks in advance
>>
>>
>>
>
>
>
> --
> Quintin Beukes
>
--
Quintin Beukes
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: Reading html-code from many different websites
Posted by Quintin Beukes <qu...@last.za.net>.
Hey,
Why not use httpclient 4? For new code it's probably the best option.
It's API is much stronger, and it's connection management will fit in
well with your requirements.
Quintin
On Fri, Aug 1, 2008 at 5:52 PM, Suladna <su...@yahoo.com> wrote:
> Hi
>
> I am making a Java-program that should read the html-code from several different websites. I am currently using this tutorial to read from one website:
>
> http://hc.apache.org/httpclient-3.x/tutorial.html
>
> My question is: do I really have to release and restart the connection after every website I read? As there are so many websites it would be good if I could instead redefine the HttpMethod instead of creating a new one for each site. Is this possible?
>
> Or is it possible to in some way connect to all the websites at the same time?
>
> Thanks in advance
>
>
>
--
Quintin Beukes
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org