I did a small review over your code. I hope you don't mind.

Narrow your exceptions as small as posible. ```python except:``` will catch everything. And maybe you catch problems you don't want to catch or want to catch in a different way.

Here I would use:
```python
except urllib.error.HTTPError:
```