Skip to content

Instantly share code, notes, and snippets.

@019ec6e2
Last active April 27, 2017 08:40
Show Gist options
  • Save 019ec6e2/6ad5e4f1f987d8762768dff71b191a93 to your computer and use it in GitHub Desktop.
Save 019ec6e2/6ad5e4f1f987d8762768dff71b191a93 to your computer and use it in GitHub Desktop.
RF Thumbnail Parser
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"
@019ec6e2
Copy link
Author

This simple script scrapes thumbnails for vimeo videos using bs4 and requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment