Created
August 18, 2019 22:08
-
-
Save ovo/134350f6518da81898b95f3a451a5cba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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