Skip to content

Instantly share code, notes, and snippets.

@kirillsulim
Created October 4, 2015 07:32
Show Gist options
  • Save kirillsulim/4f6bd337cd85bd474b1d to your computer and use it in GitHub Desktop.
Save kirillsulim/4f6bd337cd85bd474b1d to your computer and use it in GitHub Desktop.
slides saver
from bs4 import BeautifulSoup
import requests
from urllib.request import urlretrieve
r = requests.get("http://www.slideshare.net/slideshow/embed_code/41339705")
soup = BeautifulSoup(r.content, "html.parser")
slides = soup.find_all("div", class_="slide")
num = 1
for slide in slides[:1]:
url = slide.img['data-full']
name = 'slides/%02d' % num + '.jpg'
urlretrieve(url, name)
print('%s saved as %s' % (url, name))
num += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment