求位巨佬..我的只能爬取第一页的某一张壁纸而不是第一页的所有 如何解决

# -*-coding:utf8-*-
from bs4 import BeautifulSoup
import requests
url="https://pic.netbian.com/"
headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
         "Cookie":"__yjs_duid=1_2a164cf046be81d7beb2763bc6cb93b61630917990494; Hm_lvt_14b14198b6e26157b7eba06b390ab763=1630918037,1630918351,1632497782; Hm_lpvt_14b14198b6e26157b7eba06b390ab763=1632497866; Hm_lvt_526caf4e20c21f06a4e9209712d6a20e=1630917991,1630918105,1630918106,1632498677; Hm_lpvt_526caf4e20c21f06a4e9209712d6a20e=1632501219"}
response=requests.get(url,headers=headers)
response1=BeautifulSoup(response.text,"html.parser")
response2=response1.find("ul",attrs={"class":"clearfix"}).find_all("a",attrs={"target":"_blank"})
for i in response2:
    href=("https://pic.netbian.com"+str(i.get('href')))
    res1=requests.get(href)
    res1.encoding='gbk'
    childpage=BeautifulSoup(res1.text,"html.parser")
    img1=childpage.find("div",attrs={"class":"photo-pic"}).find("a",attrs={"id":"img"}).find("img").get("src")
    src="https://pic.netbian.com/"+str(img1)
    f=open("壁纸%s.jpg",mode="wb")
    f.write(requests.get(src).content)

逐步调试呀。

    f=open("壁纸%s.jpg",mode="wb")
    f.write(requests.get(src).content)

%s 你是想输出什么呢?你一直都是在打开 ”壁纸%s.jpg“ 这个文件进行操作,当然最后只有一个图片,被后面的图片覆盖掉了