資源簡介
通過python技術,對任意一個中的所有圖片進行下載,存在文件目錄中,學習python必備
代碼片段和文件信息
#!/usr/bin/python
import?re
import?urllib
def?getHtml(url):
page?=?urllib.urlopen(url)
html?=??page.read()
return?html
def?getImg(html):
reg?=?r‘src=“(.*?\.jpg)“?pic_ext‘
imgre?=?re.compile(reg)
imglist?=?re.findall(im
評論
共有 條評論