On Jul 4, 12:42 am, Ben Cartwright <[EMAIL PROTECTED]> wrote:
> On Jul 3, 11:14 am, Adrian Smith <[EMAIL PROTECTED]> wrote:
>
> > > > The following (pinched
> > > > from Dive Into Python) seems to work perfectly in Idle, but
> > > > falls at the final hurdle when run as a cgi script
> > > Put this
* Adrian Smith <[EMAIL PROTECTED]> [2007-07-03 08:14:32]:
> some access. Apparently there's a way to change the user-agent string
> by subclassing urllib's URLopener class, but that's beyond my comfort
> zone at present.
Read the urllib2 how-to located at ActiveState Documentation pages.
That giv
Adrian Smith wrote:
> I'm trying to use urllib2 to download a page (I'd rather use urllib,
> but I need to change the User-Agent header to look like a browser or
> G**gle won't send it to me, the big meanies). The following (pinched
> from Dive Into Python) seems to work perfectly in Idle, but fall
On Jul 3, 11:14 am, Adrian Smith <[EMAIL PROTECTED]> wrote:
> > > The following (pinched
> > > from Dive Into Python) seems to work perfectly in Idle, but
> > > falls at the final hurdle when run as a cgi script
> > Put this at the top of your cgi script:
>
> > import cgitb; cgitb.enable()
Did you
On Jul 3, 11:25 pm, Ben Cartwright <[EMAIL PROTECTED]> wrote:
> On Jul 3, 9:43 am, Adrian Smith <[EMAIL PROTECTED]> wrote:
>
> > The following (pinched
> > from Dive Into Python) seems to work perfectly in Idle, but
> > falls at the final hurdle when run as a cgi script - can
> > anyone suggest any
On Jul 3, 9:43 am, Adrian Smith <[EMAIL PROTECTED]> wrote:
> The following (pinched
> from Dive Into Python) seems to work perfectly in Idle, but falls at
> the final hurdle when run as a cgi script - can anyone suggest
> anything I may have overlooked?
>
> request = urllib2.Request(some_URL)
> req
I'm trying to use urllib2 to download a page (I'd rather use urllib,
but I need to change the User-Agent header to look like a browser or
G**gle won't send it to me, the big meanies). The following (pinched
from Dive Into Python) seems to work perfectly in Idle, but falls at
the final hurdle when r