Selaa lähdekoodia

Scraping steam discounted prices using beautiful soup

David Leonard 10 vuotta sitten
vanhempi
commit
99ce05df8b
1 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 12 1
      hackathon_starter/hackathon/scripts/scraper.py

+ 12 - 1
hackathon_starter/hackathon/scripts/scraper.py

@@ -35,4 +35,15 @@ for discountedGame in discount:
 	for tag in span:
 		gameDiscounts.append(tag.text)
 
-print gameDiscounts
+print gameDiscounts
+
+price = soup.findAll('div', {'class': 'col search_price discounted'})
+
+prices = []
+# Get all discounted prices
+for value in price:
+	br = value.findAll('br')
+	for tag in br:
+		prices.append(tag.text.strip('\t'))
+
+print prices