Skip to content

Instantly share code, notes, and snippets.

@ovo
Created August 18, 2019 22:08
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 ovo/134350f6518da81898b95f3a451a5cba to your computer and use it in GitHub Desktop.
Save ovo/134350f6518da81898b95f3a451a5cba to your computer and use it in GitHub Desktop.
import os
import requests
import urllib.request
from bs4 import BeautifulSoup
SUPREME_SEASON = 'fallwinter2019'
r = requests.get('https://supremenewyork.com/previews/' + SUPREME_SEASON + '/all')
soup = BeautifulSoup(r.text, 'html.parser')
os.mkdir('supreme')
for img in soup.find_all('img'):
splitlink = img.get('src').split('/')
splitlink[4] = 'zo'
link = 'http:' + '/'.join(splitlink)
name = img.find_parent('a').get('href').split('/')
urllib.request.urlretrieve(link, os.path.join('supreme', name[4]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment