[Tutor] HTML page status

Luke Paireepinart rabidpoobear at gmail.com
Tue Sep 12 07:32:19 CEST 2006


Johan Geldenhuys wrote:
> Hi all,
>
> I looked a little bit at the urllib and it all looks fairly easy.
> What I didn't see, if it is there, was how to know or identify if a page 
> was successfully downloaded. I want to do tests to see if a connection 
> to a webpage was successful by parsing whatever came back.
>
> Will this be the easiest way of doing this or is there a different way 
> of testing the availability of webpages? Let's say I can connect to a 
> webpage, but it failed to upload 100%, how will I know that the 
> connection was not 100% successful? I'm not very familiar with url 
> parsing and HTML to know if there are other indicators to notify me if a 
> page or any web access is possible.
>
> Once this was done, can I add features to say how fast the page was 
> downloaded?
>
>   
if you use httplib you can capture the returned headers and look at the 
error code.
404 if the page wasn't found,etc etc.
I'm really bad at using it so I won't attempt to give you an example.
GIYF I guess :)
-Luke
> Thanks
>
> Johan
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>   



More information about the Tutor mailing list