python - Problems getting JSON with urllib.URLopener -
i have problems getting json urllib.urlopener
when can see in navigator.
code:
import urllib import json json_obj = urllib.urlopener() json_obj.retrieve(json_adress, self.home + "/.cache/program/file.json")
error:
('http error', 404, 'not found', <httplib.httpmessage instance @ 0x7fa73d9b3a28>)
5 minutes later can it, address fails. happening?
for example, url of json file is:
http://webservices.francetelevisions.fr/tools/getinfosoeuvre/v2/?iddiffusion=135842229&catalogue=pluzz&callback=webservicecallback_135842229
the url trying access hosted on cdn, , not servers appear have content requested:
$ host webservices.francetelevisions.fr webservices.francetelevisions.fr alias www-es.francetelevisions.fr. www-es.francetelevisions.fr alias francetv.fr.edgesuite.net. francetv.fr.edgesuite.net alias a253.w5.akamai.net. a253.w5.akamai.net has address 23.3.13.170 a253.w5.akamai.net has address 23.3.13.176
the exact address computer given when looking hostname depends on geographical location; resolving dns aliases, dns server uses your ip address guess server might closer in network.
it may updates rolled out cdn machines gradually, or given different ip address contact later on, after first dns lookup has expired. either way, there little can python; unless know origin server (which not disclosed website avoid overloading), have go normal flow of cdn updates.
Comments
Post a Comment