Can you get a stacktrace for the error?
either
a) comment out the "except urllib2.URLError" section and run it manually
or
b) include stacktrace in your error log see https://docs.python.org/2/library/traceback.html
That might give you more information on the failure.
It may be that this is a temporary network error or time-out and that you have to have your program wait and re-try.