Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib,re,os
- BASE_URL='http://truyentranh8.net/berserk-chap-%d'
- img_regex=re.compile("http.*blogspot.*jpg")
- ## print img_regex.findall(open("a.html").read())
- for i in range(300):
- path_dir='chap-%d/'%(i)
- if(os.path.isdir(path_dir)):
- continue
- print i
- os.mkdir(path_dir)
- content=urllib.urlopen(BASE_URL%(i)).read()
- ls_img=img_regex.findall(content)
- for j in ls_img:
- urllib.urlretrieve(j,path_dir+os.path.basename(j))
Add Comment
Please, Sign In to add comment