I found this code in here : Is there a way to get Bing's photo of the day?
I'm sorry I couldn't comment there so I'm asking here. but I have a few problems. when I run it in Debian, it says " list index out of range" I don't understand how to fix this. I'm sorry if that sounds dumb of me.
#!/usr/bin/python3
from bs4 import BeautifulSoup
import os
import urllib
from urllib.request import urlopen
BingXML_URL ="http://www.bing.com/HPImageArchive.aspx?"
page= urlopen(BingXML_URL).read()
BingXml =BeautifulSoup(page, "lxml")
Images = BingXml.find_all('image')
ImageURL ="https://www.bing.com" + Images[0].url.text
ImageName = Images[0].startdate + ".jpg"
urllib.urlretrieve(ImageURL, ImageName)