Created
October 4, 2015 07:32
-
-
Save kirillsulim/4f6bd337cd85bd474b1d to your computer and use it in GitHub Desktop.
slides saver
This file contains hidden or 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
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