urllib2 urlopen works very randomly
问题 For some reasons this part where I fetch JSON data from following url will only works sometimes. And sometimes it will return 404 error, and complain about missing header attribute. It will work 100% of the time if I paste it onto a web browser. So I'm sure the link is not broken or something. I get the following error in Python: AttributeError: 'HTTPError' object has no attribute 'header' What's the reason for this and can it be fixed? Btw I removed API key since it is private. try: url =