Last active
April 27, 2017 08:40
-
-
Save 019ec6e2/6ad5e4f1f987d8762768dff71b191a93 to your computer and use it in GitHub Desktop.
RF Thumbnail Parser
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
from bs4 import BeautifulSoup | |
import requests | |
import re | |
page = requests.get('https://www.rentaphoto.com/rentaphototv') | |
soup = BeautifulSoup(page.text, 'html.parser') | |
print page.status_code | |
columns = soup.findAll('a', href = re.compile('vimeo.com/\d''')) | |
for i in range (0, columns.__len__()): | |
current = str(columns[i])[27:].split('"')[0] | |
print columns[i] | |
xml = requests.get('http://vimeo.com/api/v2/video/' + current + '.xml') | |
xmlsoup = BeautifulSoup(xml.text, 'xml') | |
thumblinks = xmlsoup.findAll('thumbnail_large') | |
print thumblinks | |
print "\n" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This simple script scrapes thumbnails for vimeo videos using bs4 and requests.