|
@@ -44,4 +44,22 @@ class Scraper:
|
44
|
44
|
except urllib2.URLError, e:
|
45
|
45
|
handleError(e)
|
46
|
46
|
|
|
47
|
+ return results
|
|
48
|
+
|
|
49
|
+ @staticmethod
|
|
50
|
+ def scrape_steam_game(credentials, base_url):
|
|
51
|
+ results = []
|
|
52
|
+ url = (base_url % credentials) + "?xml=1"
|
|
53
|
+
|
|
54
|
+ try:
|
|
55
|
+ result = urllib2.urlopen(url).read()
|
|
56
|
+ soup = BeautifulSoup(result)
|
|
57
|
+ for ach in soup.findAll('achievement', {'closed': '1'}):
|
|
58
|
+ results.append({'img': ach.find('iconclosed').string.strip(),
|
|
59
|
+ 'title': ach.find('name').string.strip(),
|
|
60
|
+ 'desc': ach.find('description').string.strip(),
|
|
61
|
+ 'date': None})
|
|
62
|
+ except urllib2.URLError, e:
|
|
63
|
+ handleError(e)
|
|
64
|
+
|
47
|
65
|
return results
|