Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- import re
- url = "http://u.caoadult.com/album/23157/?page=%s"
- baseurl = "http://u.caoadult.com/media/photos/"
- target = open("output.txt", 'w')
- for i in xrange(1, 21):
- u = url % i
- urlcontent = urllib2.urlopen(u).read()
- imgurls=re.findall('img .*?src="/media/photos/(.*?)"',urlcontent)
- for imgurl in imgurls:
- print baseurl+imgurl
- target.write(baseurl+imgurl+'\n')
- target.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement