I have been using urllib.request.FancyURLOpener() to retrieve images from URLs. My code is something like this:
class MyOpener(FancyURLopener):
version = "Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
myopener = MyOpener()
myopener.retrieve(source_url, saved_img_path)
However, when I instantiate a MyOpener() object, I get the following warning:
DeprecationWarning: MyOpener style of invoking requests is deprecated. Use newer urlopen functions/methods
What method(s) should I be using instead?