You are not logged in.

#1 2010-04-11 17:14:23

SemiBz
Member
From: Riga, Latvia
Registered: 2010-01-30
Posts: 80

[ Python ] urllib2 retvrieved data changes without a reason ?

#!/usr/bin/env python

import urllib2

def getLastModified(url):
    sock = urllib2.urlopen(url)
    return sock.info().get("Last-Modified")


print "TV-NET: ", getLastModified("http://www.tvnet.lv")

pythonurllib2bugl.th.png

As you see in the screenshot, the page was last modified @ 20:04:21 - urllib2 request randomly returns the right and the wrong answers .. 20:04:21 ( corrent ) and 20:04:49 ( wrong ).

Am I missing something here ?

Offline

Board footer

Powered by FluxBB