On Fri, 17 Jun 2011 20:53:39 +0300, gervaz wrote:
I decided to implement this solution:
class HeadRequest(urllib.request.Request):
def get_method(self):
return "HEAD"
Now I download the url using:
r = HeadRequest(url, None, self.headers)
c = urllib.request.urlopen(r)
but I don't
On 17 Giu, 12:14, Adam Tauno Williams wrote:
> On Thu, 2011-06-16 at 15:43 -0700, gervaz wrote:
> > Hi all, can someone tell me why the read() function in the following
> > py3 code returns b''
> > >>> h = http.client.HTTPConnection("www.twitter.com")
> > >>> h.connect()
> > >>> h.request("HEAD",
On Thu, 2011-06-16 at 15:43 -0700, gervaz wrote:
> Hi all, can someone tell me why the read() function in the following
> py3 code returns b''
> >>> h = http.client.HTTPConnection("www.twitter.com")
> >>> h.connect()
> >>> h.request("HEAD", "/", "HTTP 1.0")
> >>> r = h.getresponse()
> >>> r.read()
On Fri, Jun 17, 2011 at 6:19 PM, gervaz wrote:
> The fact is that I have a list of urls and I wanted to retrieve the
> minimum necessary information in order to understand if the link is a
> valid html page or e.g. a picture or something else. As far as I
> understood here http://www.w3.org/Protoc
On 17 Giu, 01:00, Ian Kelly wrote:
> On Thu, Jun 16, 2011 at 4:43 PM, gervaz wrote:
> > Hi all, can someone tell me why the read() function in the following
> > py3 code returns b''?
>
> h = http.client.HTTPConnection("www.twitter.com")
> h.connect()
> h.request("HEAD", "/", "HTTP
On Thu, Jun 16, 2011 at 4:43 PM, gervaz wrote:
> Hi all, can someone tell me why the read() function in the following
> py3 code returns b''?
>
h = http.client.HTTPConnection("www.twitter.com")
h.connect()
h.request("HEAD", "/", "HTTP 1.0")
r = h.getresponse()
r.read()
> b
Hi all, can someone tell me why the read() function in the following
py3 code returns b''?
>>> h = http.client.HTTPConnection("www.twitter.com")
>>> h.connect()
>>> h.request("HEAD", "/", "HTTP 1.0")
>>> r = h.getresponse()
>>> r.read()
b''
Thanks,
Mattia
--
http://mail.python.org/mailman/listi