Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread MRAB
On Feb 8, 6:20 pm, "k0mp" <[EMAIL PROTECTED]> wrote: > On Feb 8, 6:54 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > > > > > k0mp wrote: > > > Is there a way to retrieve a web page and before it is entirely > > > downloaded, begin to test if a specific string is present and if yes > > > stop the do

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
On Feb 8, 8:02 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > k0mp wrote: > > It seems to take more time when I use read(size) than just read. > > I think in both case urllib.openurl retrieve the whole page. > > Google's home page is very small, so it's not really a great test of > that. Here's a t

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
On Feb 8, 8:06 pm, Björn Steinbrink <[EMAIL PROTECTED]> wrote: > On Thu, 08 Feb 2007 10:20:56 -0800, k0mp wrote: > > On Feb 8, 6:54 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > >> k0mp wrote: > >> > Is there a way to retrieve a web page and before it is entirely > >> > downloaded, begin to test i

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Björn Steinbrink
On Thu, 08 Feb 2007 10:20:56 -0800, k0mp wrote: > On Feb 8, 6:54 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: >> k0mp wrote: >> > Is there a way to retrieve a web page and before it is entirely >> > downloaded, begin to test if a specific string is present and if yes >> > stop the download ? >> >

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Leif K-Brooks
k0mp wrote: > It seems to take more time when I use read(size) than just read. > I think in both case urllib.openurl retrieve the whole page. Google's home page is very small, so it's not really a great test of that. Here's a test downloading the first 512 bytes of an Ubuntu ISO (beware of wrap)

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
On Feb 8, 6:54 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > k0mp wrote: > > Is there a way to retrieve a web page and before it is entirely > > downloaded, begin to test if a specific string is present and if yes > > stop the download ? > > I believe that urllib.openurl(url) will retrieve the who

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Leif K-Brooks
k0mp wrote: > Is there a way to retrieve a web page and before it is entirely > downloaded, begin to test if a specific string is present and if yes > stop the download ? > I believe that urllib.openurl(url) will retrieve the whole page before > the program goes to the next statement. Use urllib.u

begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
Hi, Is there a way to retrieve a web page and before it is entirely downloaded, begin to test if a specific string is present and if yes stop the download ? I believe that urllib.openurl(url) will retrieve the whole page before the program goes to the next statement. I suppose I would be able to d