Make wget functionality compatible with Python 3