import requestsimport reimport timelocal = time.strftime("%Y.%m.%d")url = 'http://cn.bing.com'con = requests.get(url).textpatern='rel="preload" href="(.*?)" as'# print(patern)res = re.findall(patern, con)[0]# print(res)pic = requests.get(url+res)with open('%s.jpg' % local, 'wb')as f: f.write(pic.content)