找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 3571|回复: 0

Python3 下载图片问题

1

主题

4

帖子

4

积分

贫民

积分
4
kimchaw 发表于 2015-9-4 20:47:45 | 显示全部楼层 |阅读模式
import urllib.request
h = "<img style"
t = ".jpg"
i = 0
posh = -len(h)
post = -len(t)
while i < s.count(h):
    posh = s.find(h, posh + len(h))
    post = s.find(t, posh + len(h))
    print(s[posh:post + len(t)])
    length = s[posh: post + len(t)]
    http = length.find("//")
    url = t[http:]
    urllib.request.urlretrieve(url)
    i += 1
怎么下载链接的图片?求各位大神帮我看看  我新手
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表