Browse Source

Scraping steam sale release dates using beautiful soup

David Leonard 10 years ago
parent
commit
975c50552a
1 changed files with 16 additions and 0 deletions
  1. 16 0
      hackathon_starter/hackathon/scripts/scraper.py

+ 16 - 0
hackathon_starter/hackathon/scripts/scraper.py

@@ -0,0 +1,16 @@
+import requests
+from bs4 import BeautifulSoup
+
+req = requests.get('http://store.steampowered.com/search/?specials=1#sort_by=_ASC&sort_order=ASC&specials=1&page=1')
+content = req.text
+soup = BeautifulSoup(content)
+
+# Get all divs of a specific class
+releaseDate = soup.findAll('div', {'class': 'col search_released'})
+
+# Get all release dates
+releaseDates = []
+for date in releaseDate:
+	releaseDates.append(date.text)
+
+print releaseDates