Skip to content

Instantly share code, notes, and snippets.

@vndmtrx
Forked from anonymous/gist:3193057
Created August 1, 2012 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vndmtrx/3230540 to your computer and use it in GitHub Desktop.
Save vndmtrx/3230540 to your computer and use it in GitHub Desktop.
InterfaceLIFT Scraper
import os, math, re, urllib
scraping = "http://interfacelift.com/wallpaper/downloads/date/widescreen/1440x900/"
goal = 10
done = 0
tag = re.compile(r"<a href=\"(?P<url>[^\"]+)\"><img src=\"/img_NEW/button_download\.png\"")
if not os.path.exists("scraped") :
os.makedirs("scraped")
for page in range(1, 1 + int(math.ceil(goal / 10.0))):
list = tag.finditer(urllib.urlopen(scraping + "index" + str(page) + ".html").read())
for i in list:
if done < goal :
print("scraping " + str(done + 1) + " of " + str(goal))
wurl = "http://interfacelift.com/" + i.group("url")
urllib.urlretrieve(wurl, "scraped/" + str(done) + ".jpg")
done += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment