网址:
http://www.netbian.com/meinv/ 代码简单只为娱乐 别喷谢谢各位大佬
import time
import requests
from bs4 import BeautifulSoup
import lxml
url = "http://www.netbian.com/meinv/"
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0)"
}
respn = requests.get(url=url,headers=header).text
soup = BeautifulSoup(respn,"lxml")
list_img1 = []
for line in range(0,25):
list_img = soup.select(".list > ul > li > a > img")[line]["src"]
list_img1.append(list_img)
for img in list_img1:
img1 = img[img.rfind("/"):]
img2 = img.replace("/","")
print(img1)
img_context = requests.get(url=img).content
with open("meinv/" + img2, "wb") as f:
f.write(img_context)
f.close()