泰宁新闻网

妹子图官网,

泰宁新闻网 http://www.tainingxinwen.cn 2021-01-12 10:03 出处:网络
妹子图官网,,爬取妹子图网站的图片 图片链接: # /home/wl/PycharmProjects/untitled

妹子图官网,,爬取妹子图网站的图片

妹子图官网,

图片链接:

妹子图官网,

# /home/wl/PycharmProjects/untitled
# -*- coding:utf-8 -*-
# author:龙
from bs4 import BeautifulSoup
import urllib.request
import os
def test():
 girl_url ='http://www.meizitu.com/'
 response = urllib.request.urlopen(girl_url).read()
 response = response.decode ('gb2312')
 #print (response)
 soup = BeautifulSoup(response,'html.parser')#创建对象
 imgs = soup.find_all('img')
 #print(imgs)
 for img in imgs:
 #print (img)
 #print (type(img))
 link = img.get('src')
 #print (link)
 name = img.get('alt')
 print("正在下载%s的图片"%name)
 urllib.request.urlretrieve(link,'image/{}.jpg'.format(name))

本文标题:妹子图官网,
http://www.tainingxinwen.cn/qitaxinxi/600609.html

0

精彩评论

暂无评论...
验证码 换一张
取 消