Luafair
import urllib
import urllib.request
import re #正则表达式
#加载页面
def load_page(url):
request=urllib.request.Request(url) #请求URL页面
response = urllib.request.urlopen(request) #等待响应
data = response.read()
return data
#下载图片
def get_image(html):
regx = r\'http://[\S]*jpg\'
pattern = re.compile(regx)
get_image=re.findall(pattern,repr(html))

num = 1
for img in get_image:
image = load_page(img)
with open(\'F:\\photo\\%s.jpg\'%num,\'wb\') as fb:
fb.write(image)
print(\'正在下载第%s张图片\'%num)
num = num+1
print(\'下载完成!\')
url=\'http://www.ivsky.com/bizhi/yourname_v39947/\'
html = load_page(url)
get_image(html)

分类:

技术点:

相关文章:

  • 2022-01-16
  • 2021-10-28
  • 2022-01-07
  • 2021-09-08
  • 2021-12-15
  • 2021-12-10
  • 2021-12-08
  • 2021-12-15
猜你喜欢
  • 2021-12-15
  • 2021-12-10
  • 2021-12-15
  • 2021-06-07
  • 2021-09-18
  • 2022-02-07
相关资源
相似解决方案