How do I pull a GIF image from a webpage?

Viewed 31
1 Answers

To save the GIF image from the webpage, use requests.get(<URL>).content directly. For example:

import requests

url = (
    "https://www.cpc.ncep.noaa.gov/products/predictions/814day/814temp.new.gif"
)

with open("814temp.new.gif", "wb") as f_out:
    f_out.write(requests.get(url).content)

This saves the file 814temp.new.gif

Related