Skip to content

Instantly share code, notes, and snippets.

@MaartenS
Created March 16, 2016 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaartenS/1c9ce27e2e507cc1757e to your computer and use it in GitHub Desktop.
Save MaartenS/1c9ce27e2e507cc1757e to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from pyquery import PyQuery as pq
import string

print '📽' # 🎥'

series = ['face_off', 'new_girl', 'big_bang_theory']
for serie in series:
    d = pq(url='http://thewatchseries.to/serie/%s' % serie)
    p = d('#left > div:nth-child(1) > ul > li')
    s = d('#left > div:nth-child(1) > h2 > a > span')

    print '---'
    print string.capwords(serie.replace('_', ' ')) + " - " + s.text()
    print '---'

    for li in p.items():
        a = li.find('a')
        if a is not None:
            print a.text().encode('utf-8') + ' | href=' + 'http://thewatchseries.to' + a.attr('href')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment