Re: [Tutor] Strategy to read a redirecting html page

2011-06-02 Thread Robert Sjoblom
On 2 June 2011 22:50, Brett Ritter wrote: > On Thu, Jun 2, 2011 at 4:06 PM, Robert Sjoblom > wrote: >> Python already has the urllib/urllib2 package that automatically >> follow redirects, so I don't see why you'd need a 3rd-party module to >> deal with it? When it encounters a 301 status code f

Re: [Tutor] Strategy to read a redirecting html page

2011-06-02 Thread Brett Ritter
On Thu, Jun 2, 2011 at 4:06 PM, Robert Sjoblom wrote: > Python already has the urllib/urllib2 package that automatically > follow redirects, so I don't see why you'd need a 3rd-party module to > deal with it? When it encounters a 301 status code from the server, Ah, but I believe the issue is tha

Re: [Tutor] Strategy to read a redirecting html page

2011-06-02 Thread Robert Sjoblom
> When you hit the page and you get an HTTP redirect code back (say, > 302), you will need to make another call to the URL specified in the > "Location" parameter in the response headers. Then you retrieve that > new page and you can check you got an acceptable HTTP response code > (such as 200) an

Re: [Tutor] Strategy to read a redirecting html page

2011-06-01 Thread Karim
On 06/01/2011 01:41 AM, Alexandre Conrad wrote: Hi Karim, When you hit the page and you get an HTTP redirect code back (say, 302), you will need to make another call to the URL specified in the "Location" parameter in the response headers. Then you retrieve that new page and you can check you go

Re: [Tutor] Strategy to read a redirecting html page

2011-05-31 Thread Alexandre Conrad
Hi Karim, When you hit the page and you get an HTTP redirect code back (say, 302), you will need to make another call to the URL specified in the "Location" parameter in the response headers. Then you retrieve that new page and you can check you got an acceptable HTTP response code (such as 200) a

Re: [Tutor] Strategy to read a redirecting html page

2011-05-31 Thread ian douglas
On 05/31/2011 04:34 PM, Hugo Arts wrote: On Wed, Jun 1, 2011 at 1:00 AM, Karim wrote: Hello, I am having issue in reading a html page which is redirected to a new page. I get the first warning/error message page and not the redirection one. Should I request a second time the same url page or

Re: [Tutor] Strategy to read a redirecting html page

2011-05-31 Thread Hugo Arts
On Wed, Jun 1, 2011 at 1:00 AM, Karim wrote: > > Hello, > > I am having issue in reading a html page which is redirected to a new page. > I get the first warning/error message page and not the redirection one. > Should I request a second time the same url page or Should I loop forever > until the

[Tutor] Strategy to read a redirecting html page

2011-05-31 Thread Karim
Hello, I am having issue in reading a html page which is redirected to a new page. I get the first warning/error message page and not the redirection one. Should I request a second time the same url page or Should I loop forever until the page content is the correct (by parsing it) one? Do you