Create a gist now

Instantly share code, notes, and snippets.

@dz0ny /metascore.py
Last active Dec 10, 2015

What would you like to do?
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
from pyquery import PyQuery
urls = ['http://www.metacritic.com/game/playstation-3/black-knight-sword',
'http://www.metacritic.com/game/pc/far-cry-3']
for url in urls:
print 'Igra:', url
req = requests.get(url)
if req.status_code is 200:
stran = PyQuery(req.text)
print 'MetaScore:', stran.find('.data.metascore span.score_value').text()
print 'User score:', stran.find('.data.avguserscore.avguserscore_favorable .score_value').text()
print 'Developer:', stran.find('li.summary_detail.developer span.data').text()
print 'Žanr:', stran.find('li.summary_detail.product_genre span.data').text()
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment